This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A286415 #28 Oct 05 2020 14:08:24 %S A286415 19,23,29,41,43,47,53,59,61,67,83,89,173,271,277,313,379,397,419,479, %T A286415 491,571,577,593,617,631,673,811,839,877,911,977,1777,1913,2131,2311, %U A286415 2377,2399,2713,2791,2939,2971,4177,4339,4919,4993,5119,5791,6133,6737,6997,7193,7333,7919,8111 %N A286415 Primes p where all the cyclic shifts of their digits to the right also produce primes except the last one before reaching p again. %C A286415 a(125)=937337931113, a(126) is larger than 10^16 (if it exists). %H A286415 Chai Wah Wu, <a href="/A286415/b286415.txt">Table of n, a(n) for n = 1..125</a> %e A286415 2131 is a member as all the cyclic shifts of its digits to the right result in primes (1213, 3121) except the last one (1312) before reaching the original prime. %t A286415 cyclDigs[k_]:= FromDigits/@ NestList[RotateRight, IntegerDigits[k], IntegerLength[k]-1]; rgtSftNearCircPrmsInBtw[m_, n_]:= ParallelMap[ If[AllTrue[Most[cyclDigs[#]], PrimeQ] && Not@ PrimeQ[Last[cyclDigs[#]]], #, Nothing] &, Prime @ Range[PrimePi[m], PrimePi[n]]]; %t A286415 rgtSftNearCircPrmsInBtw[19, 10^7] %t A286415 cspQ[n_]:=Module[{t=PrimeQ[FromDigits/@Table[RotateRight[IntegerDigits[ n],k],{k,IntegerLength[n]-1}]]},Last[t]==False&&Union[Most[t]]=={True}]; Join[ {19,23,29,41,43,47,53,59,61,67,83,89},Select[ Prime[ Range[ 26,1100]],cspQ]] (* _Harvey P. Dale_, Oct 05 2020 *) %o A286415 (Python) %o A286415 from itertools import product %o A286415 from sympy import isprime %o A286415 A286415_list = [] %o A286415 for l in range(1,15): %o A286415 for d in '123456789': %o A286415 for w in product('1379',repeat=l): %o A286415 s = d+''.join(w) %o A286415 n = int(s) %o A286415 for i in range(l): %o A286415 if not isprime(int(s)): %o A286415 break %o A286415 s = s[-1]+s[:-1] %o A286415 else: %o A286415 if not isprime(int(s)): %o A286415 A286415_list.append(n) # _Chai Wah Wu_, May 21 2017 %Y A286415 Cf. A270083 (subsequence of), A286333. %K A286415 nonn,base %O A286415 1,1 %A A286415 _Mikk Heidemaa_, May 08 2017