OFFSET
1,1
COMMENTS
Conjecture: The sequence is finite.
From Michael De Vlieger, Dec 30 2017: (Start)
Primes in this sequence must only have odd digits.
There are 8 terms with 2 octal digits, 20 terms with 4 octal digits, 12 terms with 6 octal digits, and 8 terms with 8 octal digits.
a(49), if it exists, must be larger than 8^12 = 68719476736. (End)
EXAMPLE
607 written in base 8 is 1137. The base-8 numbers 1137, 1371, 3711, 7113 written in base 10 are 607, 761, 1993, 3659, respectively, and all those numbers are prime, so 607, 761, 1993 and 3659 are terms of the sequence.
MATHEMATICA
With[{b = 8}, Select[Prime@ Range[PrimePi@ b + 1, 10^6], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* or *)
With[{b = 8}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[Range[1, 7, 2], #] &, 6, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
PROG
(PARI) rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
forprime(p=1, , if(vecmin(digits(p, 8))!=vecmax(digits(p, 8)), if(is_circularprime(p, 8), print1(p, ", "))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Dec 30 2017
STATUS
approved