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-10 of 14 results. Next

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

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

A323396 Irregular array read by rows, where T(n, k) is the k-th prime that is both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

2, 23, 2, 3, 11, 2, 3, 13, 17, 67, 2, 3, 5, 17, 23, 83, 191, 479, 839, 2, 3, 5, 17, 19, 23, 37, 2, 3, 5, 7, 19, 23, 29, 31, 43, 47, 59, 61, 139, 157, 239, 251, 331, 349, 379, 479, 491, 1867, 2, 3, 5, 7, 23, 29, 47, 173, 2, 3, 5, 7, 23, 37, 53, 73, 313, 317, 373, 797, 3137, 3797, 739397
Offset: 3

Views

Author

Daniel Suteu and Felix Fröhlich, Jan 13 2019

Keywords

Comments

The n-th row contains A323390(n) terms.
The largest term in the n-th row is given by A323137(n).

Examples

			Rows for n = 3..7:
  [2, 23]
  [2,  3, 11]
  [2,  3, 13, 17, 67]
  [2,  3,  5, 17, 23, 83, 191, 479, 839]
  [2,  3,  5, 17, 19, 23,  37]
		

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));
    row(n) = vecsort(bothTruncatablePrimesInBase(n));
    T(n,k) = row(n)[k];

A103483 Length of the largest right-truncatable prime (in base n).

Original entry on oeis.org

0, 4, 4, 5, 7, 5, 8, 10, 8, 10, 10, 10, 17, 13, 14, 18, 15, 15, 17, 18, 20, 15, 24, 18, 19, 21, 21, 22, 22, 22, 23, 23, 25, 24, 24, 26, 27, 27, 29, 26, 29, 30, 27, 31, 31, 28, 32, 32, 33, 35, 36, 31
Offset: 2

Views

Author

Martin Renner, Mar 21 2005, Sep 24 2007, Jul 22 2008

Keywords

Crossrefs

A323390 Total number of primes that are both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

0, 2, 3, 5, 9, 7, 22, 8, 15, 6, 35, 11, 37, 17, 22, 12, 69, 12, 68, 18, 44, 13, 145, 16, 47, 20, 77, 13, 291, 15, 89, 27, 74, 20, 241, 18, 106, 25, 134, 15, 450, 23, 144, 33, 131, 24, 491, 27, 235, 29, 187, 23, 575, 30, 218, 31, 183, 25, 1377, 26, 247, 37, 231
Offset: 2

Views

Author

Daniel Suteu, Jan 13 2019

Keywords

Examples

			For n = 2, there are no both-truncatable primes, therefore a(2) = 0.
For n = 3, there are 2 both-truncatable primes: 2, 23.
For n = 4, there are 3 both-truncatable primes: 2, 3, 11.
For n = 5, there are 5 both-truncatable primes: 2, 3, 13, 17, 67.
For n = 6, there are 9 both-truncatable primes: 2, 3, 5, 17, 23, 83, 191, 479, 839.
		

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) = #(bothTruncatablePrimesInBase(n));

A129671 Right truncatable primes in base 5 (written in decimal form).

Original entry on oeis.org

2, 3, 13, 11, 17, 19, 59, 67, 89, 97, 337, 449, 487, 2437
Offset: 1

Views

Author

Martin Renner, Jun 01 2007

Keywords

Comments

There are exactly 14 right truncatable primes in base 5.

Crossrefs

A129692 Right truncatable primes in base 8 (written in decimal form).

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 23, 29, 31, 41, 43, 47, 59, 61, 137, 139, 157, 191, 233, 239, 251, 331, 347, 349, 379, 383, 479, 491, 1097, 1103, 1117, 1259, 1531, 1867, 1871, 1913, 2011, 2777, 2797, 3037, 3067, 3833, 3929, 3931, 8779, 8783, 8831, 8941, 10079, 12251
Offset: 1

Views

Author

Martin Renner, Jun 01 2007

Keywords

Comments

There are exactly 68 right truncatable primes in base 8.

Crossrefs

A129693 Right truncatable primes in base 9 (written in decimal form).

Original entry on oeis.org

2, 3, 5, 7, 19, 23, 29, 31, 47, 53, 67, 71, 173, 179, 211, 263, 269, 281, 283, 431, 479, 607, 641, 643, 647, 1559, 1613, 1619, 1901, 1907, 2371, 2423, 2531, 2549, 2551, 3881, 5471, 5791, 5827, 14033, 14519, 17117, 17167, 21341, 21347, 22783, 22787, 22943
Offset: 1

Views

Author

Martin Renner, Jun 01 2007

Keywords

Comments

There are exactly 68 right truncatable primes in base 9.

Crossrefs

Programs

  • Maple
    Extend:= proc(n) op(select(isprime, [seq(9*n+k,k=1..8)])) end proc:
    S:= {}: Agenda:= {2,3,5,7}:
    while Agenda <> {} do
      S:= S union Agenda;
      Agenda:= map(Extend, Agenda);
    od:
    sort(convert(S,list)); # Robert Israel, Mar 25 2018

A129669 Right truncatable primes in base 3 (written in decimal form).

Original entry on oeis.org

2, 7, 23, 71
Offset: 1

Views

Author

Martin Renner, Jun 01 2007

Keywords

Comments

There are exactly 4 right truncatable primes in base 3.

Crossrefs

Showing 1-10 of 14 results. Next