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.

Showing 1-9 of 9 results.

A293663 Circular primes that are not repunits.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 197, 199, 311, 337, 373, 719, 733, 919, 971, 991, 1193, 1931, 3119, 3779, 7793, 7937, 9311, 9377, 11939, 19391, 19937, 37199, 39119, 71993, 91193, 93719, 93911, 99371, 193939, 199933, 319993, 331999, 391939
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Relative complement of A004022 in A068652.
Conjecture: The sequence is finite.
From Michael De Vlieger, Dec 30 2017: (Start)
Primes > 5 in this sequence must only have digits that are in the reduced residue system modulo 10, i.e., {1, 3, 7, 9}.
There are 54 terms that have 6 or fewer decimal digits, the largest of which is 999331.
a(55) must be larger than 10^11. (End) [Corrected by Felix Fröhlich, Mar 15 + 24 2019]
From Felix Fröhlich, Mar 16 2019: (Start)
a(55) > 10^23 if it exists (cf. De Geest link).
Numbers k such that A262988(k) = A055642(k). (End)

Examples

			The numbers resulting from cyclic permutations of the digits of 1193 are 1931, 9311 and 3119, respectively and all those numbers are prime, so 1193, 1931, 3119 and 9311 are terms of the sequence.
		

Crossrefs

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

Programs

  • Mathematica
    Select[Prime@ Range[10^5], Function[w, And[AllTrue[Array[FromDigits@ RotateRight[w, #] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits@ # &] (* or *)
    Select[Flatten@ Array[FromDigits /@ Most@ Rest@ Tuples[{1, 3, 7, 9}, #] &, 9, 2], Function[w, And[AllTrue[Array[FromDigits@ RotateRight[w, #] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits@ # &] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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
    is_circularprime(p) = my(d=digits(p), r=rot(d)); if(vecmin(d)==0, return(0), while(1, if(!ispseudoprime(eva(r)), return(0)); r=rot(r); if(r==d, return(1))))
    forprime(p=1, , if(vecmax(digits(p)) > 1, if(is_circularprime(p), print1(p, ", "))))
    
  • PARI
    /* The following is a much faster program that only tests numbers whose decimal expansion consists of digits from the set {1, 3, 7, 9}. */
    eva(n) = subst(Pol(n), x, 10)
    next_v(vec) = my(k=#vec); if(vecmin(vec)==9, vec=concat(vector(#vec, t, 1), [3]); return(vec)); while(k > 0, if(vec[k]==9, vec[k]=1, if(vec[k]==3, vec[k]=7; return(vec), vec[k]=vec[k]+2, return(vec))); k--)
    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
    search(n) = my(d=digits(n), e=[], ed=0); while(1, e=rot(d); while(1, if(!ispseudoprime(eva(e)), break, e=rot(e); if(e==d && ispseudoprime(eva(e)), print1(eva(d), ", "); break))); d=next_v(d))
    searchfrom(n) = if(n < 12, forprime(p=n, 10, print1(p, ", ")); search(13), my(d=digits(n)); for(k=1, #d, if(d[k]%2==0, d[k]++, if(d[k]==5, d[k]=7))); search(eva(d)))
    /* Start a search from 1 upwards as follows: */
    searchfrom(1) \\ Felix Fröhlich, Mar 23 2019

A293142 Largest nonrepunit base-n circular prime (conjectured).

Original entry on oeis.org

7, 1013, 3121, 211
Offset: 3

Views

Author

Felix Fröhlich, Oct 01 2017

Keywords

Comments

A circular prime is a prime where all numbers produced by cyclic permutations of the digits are also prime.
No nonrepunit circular prime exists in base 2, since any nonrepunit prime contains at least one 0 digit in its base-2 representation that yields an even number and thus a composite when permuted to the least significant place, so the offset of the sequence is 3.
a(3)-a(6) were found via a brute-force approach searching from the largest prime with 12 base-n digits backwards. The number of base-n digits in a(n) for n = 3, 4, 5, 6 is 2, 5, 5, 3, respectively. Since this is much shorter than 12 digits, it is conjectured that the terms are the maximal circular primes for those bases. This also verifies that no circular primes with a length between A055642(a(n)) and 13 digits exist in bases 3, 4, 5 and 6.
Candidates for a(7), a(8) and a(9) are 13143449029, 16244441 and 4717103, respectively.
a(10) is probably 999331. If not, it must have more than 23 digits (cf. De Geest link).

Examples

			1013 written in base 4 is 33311. The base-4 numbers 33311, 33113, 31133, 11333, 13331 written in base 10 are 1013, 983, 863, 383 and 509, respectively. All those base-10 numbers are prime and since there is no larger prime up to 12 base-4 digits where all cyclic permutations of base-4 digits are primes, 1013 is conjectured to be the largest nonrepunit circular prime in base 4.
		

Crossrefs

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

Programs

  • 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))))
    a(base, maxlength) = my(p=precprime(base^maxlength)); while(p > 2, if(vecmin(digits(p, base))!=vecmax(digits(p, base)), if(is_circularprime(p, base), return(p))); p=precprime(p-1))
    for(n=3, 6, print1(a(n, 12), ", ")) \\ start searching a(n) from largest prime with 12 base-n digits backwards

A293657 Base-4 circular primes that are not base-4 repunits.

Original entry on oeis.org

7, 13, 23, 29, 53, 383, 509, 863, 983, 1013
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 1013 being the last term (see A293142).
Written in base 4 (A007090), the terms are 13, 31, 113, 131, 311, 11333, 13331, 31133, 33113, 33311. - Antti Karttunen, Nov 26 2017
From Michael De Vlieger, Dec 30 2017: (Start)
The digits of primes in this sequence must be in the reduced residue system modulo 4, i.e., {1, 3}.
a(11), if it exists, must be larger than 4^21 = 4398046511104. (End)

Examples

			53 written in base 4 is 311. The base-4 numbers 311, 131, 113 written in base 10 are 53, 29, 23, respectively and all those numbers are prime, so 23, 29 and 53 are terms of the sequence.
		

Crossrefs

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

Programs

  • Mathematica
    With[{b = 4}, Select[Array[Map[If[Union@ # == {1}, 0, FromDigits[#, b]] &, NestList[RotateLeft, #, Length@ # - 1]] &@ IntegerDigits[Prime@ #, b] &, 10^6, If[PrimeQ@ b, #, # + 1] &@ PrimePi@ b], AllTrue[#, PrimeQ] &][[All, 1]] ] (* Michael De Vlieger, Nov 26 2017 *)
    With[{b = 4}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[{1, 3}, #] &, 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 *)
  • 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, 4))!=vecmax(digits(p, 4)), if(is_circularprime(p, 4), print1(p, ", "))))

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, ", "))))

A293659 Base-6 circular primes that are not base-6 repunits.

Original entry on oeis.org

11, 31, 71, 191, 211
Offset: 1

Views

Author

Felix Fröhlich, Oct 28 2017

Keywords

Comments

Conjecture: The sequence is finite, with 211 being the last term (see A293142).
Written in base 6 (A007092), the terms are 15, 51, 155, 515, 551. - Antti Karttunen, Nov 26 2017
From Michael De Vlieger, Dec 30 2017: (Start)
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.
a(6), if it exists, must be larger than 6^21 = 21936950640377856. (End)

Examples

			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.
		

Crossrefs

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

Programs

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

A293661 Base-8 circular primes that are not base-8 repunits.

Original entry on oeis.org

13, 29, 31, 41, 43, 47, 59, 61, 607, 719, 751, 761, 971, 1021, 1657, 1759, 1787, 1913, 1993, 2011, 2687, 3019, 3659, 3673, 3677, 3803, 3919, 4073, 49103, 56299, 62207, 105341, 130681, 177007, 188249, 195277, 235513, 237151, 251501, 259019, 4127707, 6807419
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

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)

Examples

			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.
		

Crossrefs

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

Programs

  • 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 *)
  • 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, ", "))))

A293662 Base-9 circular primes that are not base-9 repunits.

Original entry on oeis.org

11, 13, 17, 19, 23, 37, 43, 47, 67, 71, 73, 79, 101, 149, 173, 181, 211, 233, 347, 421, 443, 613, 641, 647, 673, 719, 727, 971, 1123, 1361, 1429, 1609, 1697, 2153, 2179, 3371, 3547, 3833, 4019, 4091, 4099, 4229, 5227, 5261, 5281, 5683, 5689, 5741, 5749, 5821
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite.

Examples

			101 written in base 9 is 122. The base-9 numbers 122, 221, 212 written in base 10 are 101, 181, 173, respectively and all those numbers are prime, so 101, 173 and 181 are terms of the sequence.
		

Crossrefs

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

Programs

  • Mathematica
    With[{b = 9}, Select[Prime@ Range[PrimePi@ b + 1, 10^3], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 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, 9))!=vecmax(digits(p, 9)), if(is_circularprime(p, 9), print1(p, ", "))))

A327811 Numbers obtained from cyclically permuting the base-7 digits of 13143449029 and converting back to decimal.

Original entry on oeis.org

2732225029, 4344971347, 5284288003, 6552690421, 7329791221, 8845405603, 8956420003, 9307441621, 9784676947, 9786942547, 13127589829, 13143449029
Offset: 1

Views

Author

Felix Fröhlich, Sep 26 2019

Keywords

Comments

All terms are prime, therefore 13143449029 is a base-7 circular prime, see A293660.
13143449029 is remarkable in that it has 12 digits in base 7 and may be the largest known nonrepunit circular prime in that base.

Examples

			Base-7 expansion | Decimal value
---------------------------------
643464321244     | 13143449029
434643212446     |  8956420003
346432124464     |  7329791221
464321244643     |  9784676947
643212446434     | 13127589829
432124464346     |  8845405603
321244643464     |  6552690421
212446434643     |  4344971347
124464346432     |  2732225029
244643464321     |  5284288003
446434643212     |  9307441621
464346432124     |  9786942547
		

Crossrefs

Programs

  • 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])
    my(d=digits(13143449029, 7), e=d, v=[]); while(1, v=concat(v, [decimal(d, 7)]); d=rot(d); if(d==e, return(vecsort(v))))

A327835 Smallest circular prime with 12 digits in base prime(n).

Original entry on oeis.org

2732225029, 314014500337, 1949332597181, 36440244156523, 123167650691711, 996133536974297, 12637043369352469, 26255687399203543, 182859787113571787
Offset: 4

Views

Author

Giovanni Resta, Sep 27 2019

Keywords

Comments

Excluding repunits, no circular primes with more than 12 digits are known, apart 58589854785907 that in base 11 has 14 digits. Also unknown are circular primes of length at least 12 in composite bases.
Repunits of 12 digits in any base b are not prime because they are always divisible by b+1.
a(4) = 2732225029 found by Felix Fröhlich.

Examples

			a(5) = 314014500337 = (111199AA988A)_11 is the smallest circular prime in base prime(5)=11 with 12 digits. By rotating its base 11 digits we obtain other 11 primes: 2881663478867, 2544462772057, 2513808162347, 2796333050257, 3107328801587, 3135601142617, 2852859684827, 2827155915937, 542325844787, 334614020137, and 315731126987.
		

Crossrefs

Showing 1-9 of 9 results.