Perl Weekly Challenge 167: Circular Primes
These are some answers to the Week 167 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few of days from now (on June 5, 2022 at 23:59). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: Circular Primes
Write a script to find out first 10 circular primes having at least 3 digits (base 10).
Please checkout wikipedia for more information.
A circular prime is a prime number with the property that the number generated at each intermediate step when cyclically permuting its (base 10) digits will also be prime.
Output:
113, 197, 199, 337, 1193, 3779, 11939, 19937, 193939, 199933
Given the task specification, I think that the suggested output is wrong. But I’ll come back to that later on.
