OFFSET
1,1
COMMENTS
Single-digit numbers are excluded. There are only 144 terms up through 10 million. - Harvey P. Dale, Sep 12 2014
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..148 a(n) for n = 1..144 from Harvey P. Dale.
EXAMPLE
176 is a term as the two cyclic shifts other than the number itself, 761 and 617, are primes.
MATHEMATICA
LiQ[n_] := Module[{s=0}, li1=IntegerDigits[n]; k=Length[li1]; t={li1}; Do[li1=RotateLeft[li1]; AppendTo[t, li1], {i, k-1}]; If[Length[Select[Table[FromDigits[p], {p, t}], PrimeQ]] == k-1, s=1]; s]; t1={}; Do[If[!PrimeQ[i] && LiQ[i]==1, AppendTo[t1, i]], {i, 10, 3112}]; t1 (* Jayanta Basu, May 03 2013 *)
cppQ[n_]:=Module[{c=FromDigits/@NestList[RotateLeft[#]&, IntegerDigits[n], IntegerLength[ n]-1]}, CompositeQ[c[[1]]]&&AllTrue[Rest[c], PrimeQ]]; Select[ Range[10, 5000], cppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 12 2014 *)
PROG
(Python)
from itertools import product
from sympy import isprime
A068653_list = []
for l in range(1, 9):
for m in product(('1379' if l > 1 else '123579'), repeat=l):
for d in '0123456789':
s = ''.join(m)+d
n = int(s)
if not isprime(n):
for k in range(len(s)-1):
s = s[1:]+s[0]
if not isprime(int(s)):
break
else:
A068653_list.append(n) # Chai Wah Wu, May 06 2017
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Feb 28 2002
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jun 21 2002
STATUS
approved