OFFSET
1,1
COMMENTS
a(125)=937337931113, a(126) is larger than 10^16 (if it exists).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..125
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Mikk Heidemaa, May 08 2017
STATUS
approved