login
Base-6 circular primes that are not base-6 repunits.
7

%I #14 Jan 06 2018 22:05:45

%S 11,31,71,191,211

%N Base-6 circular primes that are not base-6 repunits.

%C Conjecture: The sequence is finite, with 211 being the last term (see A293142).

%C Written in base 6 (A007092), the terms are 15, 51, 155, 515, 551. - _Antti Karttunen_, Nov 26 2017

%C From _Michael De Vlieger_, Dec 30 2017: (Start)

%C This sequence may be particularly constrained to few terms since only {1, 5} are coprime to 6, and any senary circular prime involves just these 2 senary digits. This is because all primes aside from {2, 3} are congruent to {1, 5} (mod 6). Since a senary number consisting of all 5's is divisible by 5 and since we have disqualified prime repunits, the sequence is probably finite.

%C a(6), if it exists, must be larger than 6^21 = 21936950640377856. (End)

%e 71 written in base 6 is 155. The base-6 numbers 155, 515, 551 written in base 10 are 71, 191, 211, respectively and all those numbers are prime, so 71, 191 and 211 are terms of the sequence.

%t With[{b = 6}, 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 *)

%t With[{b = 6}, Select[Flatten@ Array[FromDigits[#, 6] & /@ Most@ Rest@ Tuples[{1, 5}, #] &, 18, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* _Michael De Vlieger_, Dec 30 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, 6))!=vecmax(digits(p, 6)), if(is_circularprime(p, 6), print1(p, ", "))))

%Y Cf. A007092, A293142.

%Y Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), 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