%I #46 Jul 31 2024 11:48:44
%S 2,3,5,7,11,13,17,31,37,71,73,79,97,113,131,197,199,311,337,373,719,
%T 733,919,971,991,1193,1931,3119,3779,7793,7937,9311,9377,11939,19391,
%U 19937,37199,39119,71993,91193,93719,93911,99371,193939,199933,319993
%N Numbers such that every cyclic permutation is a prime.
%C See the closely related sequence A016114 for further information. - _N. J. A. Sloane_, May 04 2017
%C These numbers are sometimes called circular primes. - _Tanya Khovanova_, Jul 29 2024
%H Ray Chandler, <a href="/A068652/b068652.txt">Table of n, a(n) for n = 1..57</a>
%H K. S. Brown, <a href="http://www.mathpages.com/home/kmath359.htm">On General Palindromic Numbers</a>
%H C. K. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=CircularPrime">Circular Primes</a>
%H Patrick De Geest, <a href="http://www.worldofnumbers.com/circular.htm">Circular Primes</a>
%H H. Heinz, <a href="http://www.magic-squares.net/primes.htm#Circular Primes">Prime Patterns (Illustration using 19937)</a>
%H Gianni A. Sarcone, <a href="http://tangente-mag.com/maths_etonnantes.php?id=3139">Tourbillonnants nombres premiers</a>, Tangente Web Site, No date.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Circular_prime">Circular prime</a>
%e 197 is a member as all the three cyclic permutations 197,971,719 are primes.
%t fQ[p_] := Module[{b = IntegerDigits[p]}, And @@ Table[PrimeQ[FromDigits[b = RotateLeft[b]]], {Length[b] - 1}]]; Select[Prime[Range[100000]], fQ] (* _T. D. Noe_, Mar 22 2012 *)
%t ecppQ[n_]:=AllTrue[FromDigits/@Table[RotateLeft[IntegerDigits[n],i],{i, IntegerLength[n]}],PrimeQ]; Select[Range[400000],ecppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Nov 25 2015 *)
%Y Cf. A003459, A016114, A091633.
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Feb 28 2002
%E More terms from _Martin Renner_, Apr 10 2002