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.

A172435 Partial sums of circular primes A016114.

Original entry on oeis.org

2, 5, 10, 17, 28, 41, 58, 95, 174, 287, 484, 683, 1020, 2213, 5992, 17931, 37868, 231807, 431740, 1111111111111542851, 11112222222222222653962
Offset: 1

Views

Author

Jonathan Vos Post, Feb 02 2010

Keywords

Comments

Circular primes are a generalization of palindromatic primes (A002385): numbers which remain prime under cyclic shifts of digits. 484 is the first square partial sum of circular primes. The subsequence of prime partial sums of circular primes begins: 2, 5, 17, 41, 683, 2213. The subsubsequence of circular prime partial sums of circular primes begins 2, 5, 17, and what is the next? What are the analogs in other bases?

Examples

			a(21) = 2 + 3 + 5 + 7 + 11 + 13 + 17 + 37 + 79 + 113 + 197 + 199 + 337 + 1193 + 3779 + 11939 + 19937 + 193939 + 199933 + 1111111111111111111 + 11111111111111111111111.
		

Crossrefs

A173819 n-th prime is a circular prime (A016114).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 12, 22, 30, 45, 46, 68, 196, 526, 1431, 2254, 17494, 17981, 27417323062119920
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 25 2010

Keywords

Comments

Comments from Charles R Greathouse IV, Mar 24 2010: 223350264196231244560 <= a(21) <= 223410574802741131526, a(22) < 1.528939387 * 10^313.

Crossrefs

Cf. A016114.

Extensions

4 more terms from R. J. Mathar, Mar 01 2010
a(20) from Charles R Greathouse IV, Apr 22 2010

A003459 Absolute primes (or permutable primes): every permutation of the digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 199, 311, 337, 373, 733, 919, 991, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

From Bill Gosper, Jan 24 2003, in a posting to the Math Fun Mailing List: (Start)
Recall Sloane's old request for more terms of A003459 = (2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 199 311 337 373 733 919 991 ...) and Richard C. Schroeppel's astonishing observation that the next term is 1111111111111111111. Absent Rich's analysis, trying to extend this sequence makes a great set of beginner's programming exercises. We may restrict the search to combinations of the four digits 1,3,7,9, only look at starting numbers with nondecreasing digits, generate only unique digit combinations, and only as needed. (We get the target sequence afterward by generating and merging the various permutations, and fudging the initial 2,3,5,7.)
To my amazement the (uncompiled, Macsyma) program printed 11,13,...,199,337, and after about a minute, 1111111111111111111!
And after a few more minutes, (10^23-1)/9! (End)
Boal and Bevis say that Johnson (1977) proves that if there is a term > 1000 with exactly two distinct digits then it must have more than nine billion digits. - N. J. A. Sloane, Jun 06 2015
Some authors require permutable or absolute primes to have at least two different digits. This produces the subsequence A129338. - M. F. Hasler, Mar 26 2008
See A039986 for a related problem with more sophisticated (PARI) code (iteration over only inequivalent digit permutations). - M. F. Hasler, Jul 10 2018

References

  • Richard C. Schroeppel, personal communication.
  • Wacław Sierpiński, Co wiemy, a czego nie wiemy o liczbach pierwszych. Warsaw: PZWS, 1961, pp. 20-21.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.

Crossrefs

Includes all of A004022 = A002275(A004023).
A258706 gives minimal representatives of the permutation classes.
Cf. A039986.

Programs

  • Haskell
    import Data.List (permutations)
    a003459 n = a003459_list !! (n-1)
    a003459_list = filter isAbsPrime a000040_list where
       isAbsPrime = all (== 1) . map (a010051 . read) . permutations . show
    -- Reinhard Zumkeller, Sep 15 2011
    
  • Mathematica
    f[n_]:=Module[{b=Permutations[IntegerDigits[n]],q=1},Do[If[!PrimeQ[c=FromDigits[b[[m]]]],q=0;Break[]],{m,Length[b]}];q];Select[Range[1000],f[#]>0&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2011 *)
    (* Linear complexity: can't reach R(19). See A258706. - Bill Gosper, Jan 06 2017 *)
  • PARI
    for(n=1, oo, my(S=[],r=10^n\9); for(a=1, 9^(n>1), for(b=if(n>2, 1-a), 9-a, for(j=0, if(b, n-1), ispseudoprime(a*r+b*10^j)||next(2)); S=concat(S,vector(if(b,n,1),k,a*r+10^(k-1)*b))));apply(t->printf(t","),Set(S))) \\ M. F. Hasler, Jun 26 2018

Formula

Conjecture: for n >= 23, a(n) = A004022(n-21). - Max Alekseyev, Oct 08 2018

Extensions

The next terms are a(25)=A002275(317), a(26)=A002275(1031), a(27)=A002275(49081).

A068652 Numbers such that every cyclic permutation is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 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
Offset: 1

Views

Author

Amarnath Murthy, Feb 28 2002

Keywords

Comments

See the closely related sequence A016114 for further information. - N. J. A. Sloane, May 04 2017
These numbers are sometimes called circular primes. - Tanya Khovanova, Jul 29 2024

Examples

			197 is a member as all the three cyclic permutations 197,971,719 are primes.
		

Crossrefs

Programs

  • Mathematica
    fQ[p_] := Module[{b = IntegerDigits[p]}, And @@ Table[PrimeQ[FromDigits[b = RotateLeft[b]]], {Length[b] - 1}]]; Select[Prime[Range[100000]], fQ] (* T. D. Noe, Mar 22 2012 *)
    ecppQ[n_]:=AllTrue[FromDigits/@Table[RotateLeft[IntegerDigits[n],i],{i, IntegerLength[n]}],PrimeQ]; Select[Range[400000],ecppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 25 2015 *)

Extensions

More terms from Martin Renner, Apr 10 2002

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

A262988 Number of distinct primes, including n if prime, obtained by cyclically shifting the digits of n.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 2, 1, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 0, 2, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Felix Fröhlich, Oct 06 2015

Keywords

Comments

First differs from A039999 at n = 103.
Differs from A061264 iff n is a term of A004022.
a(n) = A055642(n) iff n is a term of A068652, except when n is also in A004022.

Examples

			a(1013) = 2, because of the four cyclic permutations of the digits of 1013 (1013, 131, 1310, 3101) two, namely 1013 and 131, are prime and those two primes are distinct.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{len = IntegerLength@ n, s = {n}}, Do[AppendTo[s, FromDigits@ RotateRight@ IntegerDigits@ s[[k - 1]]], {k, 2, len}]; DeleteDuplicates@ Select[s, PrimeQ]]; Array[ Length@ f@ # &, {87}] (* Michael De Vlieger, Oct 07 2015 *)
  • 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
    eva(n) = x=0; for(k=1, #n, x=x+(n[k]*10^(#n-k))); x
    a(n) = i=0; r=rot(digits(n)); while(r!=digits(n), if(ispseudoprime(eva(r)), i++); r=rot(r)); if(ispseudoprime(eva(r)), i++); i

A247153 a(n) = smallest prime p for which cyclic digit shifts produce exactly n different primes, or 0 if no such p exists for n.

Original entry on oeis.org

2, 13, 113, 1193, 11939, 193939, 17773937, 119139133, 111133719913, 111119917373, 111393733793, 1117739771979737
Offset: 1

Views

Author

Felix Fröhlich, Nov 21 2014

Keywords

Comments

a(n) is equal to the smallest n-digit non-repunit prime in A016114, unless no n-digit non-repunit prime exists in A016114. In that case, the number of digits of a(n), if it exists, must be > n.
From David A. Corneth, Aug 06 2018: (Start)
Do we have leading digit of a(n) <= any digit from a(n)?
For n > 1, can a(n) contain a digit d with gcd(10, d) > 1? (End)
Smallest prime p such that A262988(p) = n. - Felix Fröhlich, Aug 06 2018

Crossrefs

Cf. A016114, A262988. This is column 1 of A317716.

Extensions

a(7)-a(8) from P. De Geest's website added by Felix Fröhlich, Nov 26 2014
a(9)-a(12) from Robert G. Wilson v, Aug 06 2018

A173818 3*n-1 is a circular prime.

Original entry on oeis.org

1, 2, 4, 6, 38, 66, 398, 1260, 3980
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 25 2010

Keywords

Crossrefs

Cf. A016114.

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.