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-7 of 7 results.

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).

A023107 Largest integer in which every prefix is prime in base n (written in base 10).

Original entry on oeis.org

71, 191, 2437, 108863, 6841, 4497359, 1355840309, 73939133, 6774006887, 18704078369, 122311273757, 6525460043032393259, 927920056668659, 16778492037124607, 4928397730238375565449, 5228233855704101657, 3013357583408354653, 1437849529085279949589, 101721177350595997080671, 185720479816277907890970001
Offset: 3

Views

Author

Keywords

Comments

Or, largest right-truncatable prime with base n>2 (in decimal form).
a(n) <= A094335(n).

Examples

			a(100) = 70123916363515199416199518301698321195339012727994799// 190371992151279729974757397909992327936943877127375781091143. - _Giovanni Resta_, Apr 11 2016
		

Crossrefs

Cf. A076586.

Programs

  • PARI
    a(n) = my(S,m,D); D=select(x->(gcd(x,n)==1),vector(n-1,j,j)); S=select(ispseudoprime,vector(n-1,i,i)); while(#S, m=vecmax(S); S=concat(vector(#D,j,select(ispseudoprime,vector(#S,i,S[i]*n+D[j]))));); m /* Max Alekseyev, Dec 09 2014 */

Extensions

More terms from Don Reble, Jun 23 2004
a(54)-a(75) in b-file from Max Alekseyev, Dec 09 2014
a(76)-a(100) in b-file from Giovanni Resta, May 01 2016

A076623 Total number of left truncatable primes (without zeros) in base n.

Original entry on oeis.org

0, 3, 16, 15, 454, 22, 446, 108, 4260, 75, 170053, 100, 34393, 9357, 27982, 362, 14979714, 685, 3062899, 59131, 1599447, 1372, 1052029701, 10484, 7028048, 98336, 69058060, 3926
Offset: 2

Views

Author

Martin Renner, Oct 22 2002, Nov 03 2002, Sep 24 2007, Feb 20 2008, Apr 20 2008

Keywords

Comments

Approximation of a(b) by (PARI) code: l(b)=c=b*(b-1)/log(b)/eulerphi(b);\ return(floor((primepi(b)-omega(b))*exp(c)/c)); - Robert Gerbicz, Nov 02 2008
a(24) = 1052029701 based on strong BPSW pseudoprimes. Other terms up to a(29) use proved primes. - Martin Fuller, Nov 24 2008

Crossrefs

Programs

  • Maple
    Lton := proc(L,b) add( op(i,L)*b^(i-1),i=1..nops(L)) ; end proc:
    A076623rec := proc(L,b) local a,d,Lext,p ; a := 0 ; for d from 1 to b-1 do Lext := [op(L),d] ; p := Lton(Lext,b) ; if isprime(p) then a := a+1 ;  a := a+procname(Lext,b) ; end if; end do: a ;end proc:
    A076623 := proc(b) A076623rec([],b) ; end proc:
    for b from 2 do print(b,A076623(b)) ; end do: # R. J. Mathar, Jun 01 2011
  • PARI
    f(b)=ct=0;A=[0];n=-1;L=1;while(L,n++;B=vector(L*b);M=0;\
    for(i=1,L,for(j=1,b-1,x=A[i]+j*b^n;if(isprime[x],M++;B[M]=x;ct++)));\
    L=M;A=vector(L,i,B[i]));return(ct) \\ Robert Gerbicz, Oct 31 2008
    
  • Python
    # works for all n; link has faster string-based version for n < 37
    from sympy import isprime, primerange
    from sympy.ntheory.digits import digits
    def fromdigits(digs, base):
        return sum(d*base**i for i, d in enumerate(digs))
    def a(n):
        prime_lists, an = [(p,) for p in primerange(1, n)], 0
        while len(prime_lists) > 0:
            an += len(prime_lists)
            candidates = set(p+(d,) for p in prime_lists for d in range(1, n))
            prime_lists = [c for c in candidates if isprime(fromdigits(c, n))]
        return an
    print([a(n) for n in range(2, 12)]) # Michael S. Branicky, Apr 27 2022

Extensions

a(12) corrected from 170051 to 170053 by Martin Fuller, Oct 31 2008
a(18) corrected by Robert Gerbicz, Nov 02 2008
a(24)-a(29) from Martin Fuller, Nov 24 2008
Entries in a-file corrected by N. J. A. Sloane, Jun 02 2011

A254755 Left-truncatable composites: every decimal suffix is a composite number.

Original entry on oeis.org

4, 6, 8, 9, 14, 16, 18, 24, 26, 28, 34, 36, 38, 39, 44, 46, 48, 49, 54, 56, 58, 64, 66, 68, 69, 74, 76, 78, 84, 86, 88, 94, 96, 98, 99, 104, 106, 108, 114, 116, 118, 124, 126, 128, 134, 136, 138, 144, 146, 148, 154, 156, 158, 164, 166, 168
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Examples

			549 is a member because 549, 49, and 9 are all composites.
		

Crossrefs

Cf. A103443 (left-truncatable primes), A202260 (right-truncatable composites), A254750.

Programs

  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    isLeftTruncatableComposite(n,b=10) = {my(k=b);if(!isComposite(n),return(0););while(n\k>0,if(!isComposite(n%k),return(0););k*=b);return(1);}

A323137 Largest prime that is both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

23, 11, 67, 839, 37, 1867, 173, 739397, 79, 105691, 379, 37573, 647, 3389, 631, 202715129, 211, 155863, 1283, 787817, 439, 109893629, 577, 4195880189, 1811, 14474071, 379, 21335388527, 2203, 1043557, 2939, 42741029, 2767, 50764713107, 853, 65467229, 4409, 8524002457
Offset: 3

Views

Author

Felix Fröhlich, Jan 05 2019

Keywords

Examples

			For n = 12: 105691 is 511B7 in base 12. Successively removing the leftmost digit yields the base-12 numbers 11B7, 1B7, B7 and 7. When converted to base 10, these are 2011, 283, 139 and 7, respectively, all primes. Successively removing the rightmost digit yields the base-12 numbers 511B, 511, 51 and 5. When converted to base 10, these are 8807, 733, 61 and 5, respectively, all primes. Since no larger prime with this property in base 12 exists (as proven by Daniel Suteu), a(12) = 105691.
		

Crossrefs

Programs

  • PARI
    digitsToNum(d, base) = sum(k=1, #d, base^(k-1) * d[k]);
    isLeftTruncatable(d, base) = my(ok=1); for(k=1, #d, if(!isprime(digitsToNum(d[1..k], base)), ok=0; break)); ok;
    generateFromPrefix(p, base) = my(seq = [p]); for(n=1, base-1, my(t=concat(n, p)); if(isprime(digitsToNum(t, base)), seq=concat(seq, select(v -> isLeftTruncatable(v, base), generateFromPrefix(t, base))))); seq;
    bothTruncatablePrimesInBase(base) = my(t=[]); my(P=primes(primepi(base-1))); for(k=1, #P, t=concat(t, generateFromPrefix([P[k]], base))); vector(#t, k, digitsToNum(t[k], base));
    a(n) = vecmax(bothTruncatablePrimesInBase(n)); \\ for n>=3; Daniel Suteu, Jan 22 2019

Formula

a(n) <= min(A023107(n), A103443(n)). - Daniel Suteu, Feb 24 2019

Extensions

a(17)-a(40) from Daniel Suteu, Jan 11 2019

A103463 Length of the largest left-truncatable prime (in base n).

Original entry on oeis.org

0, 3, 6, 6, 17, 7, 15, 10, 24, 9, 32, 8, 26, 22, 25, 11, 43, 14, 37, 27, 37, 17, 53, 20, 39, 28, 46, 19
Offset: 2

Views

Author

Martin Renner, Mar 21 2005, Feb 20 2008, Apr 20 2008

Keywords

Comments

The next term (base 30) will be difficult to calculate because there are over a trillion left-truncatable primes in that base for each of digit-lengths 29-34. Nevertheless, the largest left-truncatable prime in this base can be estimated by theory to have a length of about 82. [Hans Havermann, Aug 16 2011]

Crossrefs

Extensions

a(24)-a(29) from Hans Havermann, Aug 16 2011

A326609 Largest minimal prime in base n (written in base 10).

Original entry on oeis.org

3, 13, 5, 3121, 5209, 2801, 76695841, 811, 66600049, 29156193474041220857161146715104735751776055777, 388177921
Offset: 2

Views

Author

Richard N. Smith, Jul 13 2019

Keywords

Comments

a(13) is (probably) 13^32020*8+183, it has 35670 digits, a(14) = 14^85*4+65, it has 99 digits, a(15) = (15^106*66-619)/7, it has 126 digits, a(16) = 16^3544*9+145, it has 4269 digits.
a(17) is the smallest prime of the form (4105*17^k-9)/16 if it exists, otherwise (probably) (73*17^111333-9)/16 (136991 digits), a(18) = 18^31*304+1 (42 digits).
Other known terms: a(20) = (20^449*16-2809)/19 (585 digits), a(22) = 22^763*20+7041 (1026 digits), a(23) is (probably) (23^800873*106-7)/11 (1090573 digits), a(24) = (24^99*512-121)/23 (138 digits), a(30) = 30^1023*12+1 (1513 digits), a(42) = (42^487*27-1093)/41 (791 digits).
a(19) is the smallest prime of the form (15964*19^k-1)/3 if it exists, otherwise (probably) (904*19^110984-1)/3 (141924 digits), a(21) is the smallest prime of the form 16*21^k+335 if it exists, otherwise (probably) (51*21^479149-1243)/4 (633542 digits).

Crossrefs

Cf. A071062 (base 10 minimal primes), A110600 (base 12 minimal primes).
Cf. A293142 (largest non-repunit permutable prime), A317689 (largest non-repunit circular prime), A103443 (largest left-truncatable prime), A023107 (largest right-truncatable prime), A323137 (largest two-sided prime), A084738 (smallest repunit prime), A186995 (smallest weakly prime).
Showing 1-7 of 7 results.