%I #17 Jan 06 2018 22:05:07
%S 7,11,13,17,19,23,167,211,239,283,359,431,547,571,1069,1249,1733,2221,
%T 2417,2713,2749,3049,3109,3121
%N Base-5 circular primes that are not base-5 repunits.
%C Conjecture: The sequence is finite, with 3121 being the last term (see A293142).
%C Written in base 5 (A007091), the terms are 12, 21, 23, 32, 34, 43, 1132, 1321, 1424, 2113, 2414, 3211, 4142, 4241, 13234, 14444, 23413, 32341, 34132, 41323, 41444, 44144, 44414, 44441. - _Antti Karttunen_, Nov 26 2017
%C a(25), if it exists, must be larger than prime(10^6) = 15485863, an 11-digit quinary number. - _Michael De Vlieger_, Nov 26 2017
%e 1069 written in base 5 is 13234. The base-5 numbers 13234, 32341, 23413, 34132, 41323 written in base 10 are 1069, 2221, 1733, 2417, 2713, respectively and all those numbers are prime, so 1069, 1733, 2221, 2417 and 2713 are terms of the sequence.
%t Select[Array[Map[If[Union@ # == {1}, 0, FromDigits[#, 5]] &, NestList[RotateLeft, #, Length@ # - 1]] &@ IntegerDigits[Prime@ #, 5] &, 10^5, 4], AllTrue[#, PrimeQ] &][[All, 1]] (* _Michael De Vlieger_, Nov 26 2017 *)
%o (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
%o decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
%o 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))))
%o forprime(p=1, , if(vecmin(digits(p, 5))!=vecmax(digits(p, 5)), if(is_circularprime(p, 5), print1(p, ", "))))
%Y Cf. A007091, A293142.
%Y Cf. base-b nonrepunit circular primes: A293657 (b=4), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).
%K nonn,base,more
%O 1,1
%A _Felix Fröhlich_, Oct 28 2017