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.
19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 173, 271, 277, 313, 379, 397, 419, 479, 491, 571, 577, 593, 617, 631, 673, 811, 839, 877, 911, 977, 1777, 1913, 2131, 2311, 2377, 2399, 2713, 2791, 2939, 2971, 4177, 4339, 4919, 4993, 5119, 5791, 6133, 6737, 6997, 7193, 7333, 7919, 8111
Offset: 1
Examples
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.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..125
Programs
-
Mathematica
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]]]; rgtSftNearCircPrmsInBtw[19, 10^7] 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 *)
-
Python
from itertools import product from sympy import isprime A286415_list = [] for l in range(1,15): for d in '123456789': for w in product('1379',repeat=l): s = d+''.join(w) n = int(s) for i in range(l): if not isprime(int(s)): break s = s[-1]+s[:-1] else: if not isprime(int(s)): A286415_list.append(n) # Chai Wah Wu, May 21 2017
Comments