cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A293658 Base-5 circular primes that are not base-5 repunits.

Original entry on oeis.org

7, 11, 13, 17, 19, 23, 167, 211, 239, 283, 359, 431, 547, 571, 1069, 1249, 1733, 2221, 2417, 2713, 2749, 3049, 3109, 3121
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 3121 being the last term (see A293142).
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
a(25), if it exists, must be larger than prime(10^6) = 15485863, an 11-digit quinary number. - Michael De Vlieger, Nov 26 2017

Examples

			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.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    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 *)
  • 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, 5))!=vecmax(digits(p, 5)), if(is_circularprime(p, 5), print1(p, ", "))))