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 13 results. Next

A076586 Total number of right truncatable primes in base n.

Original entry on oeis.org

0, 4, 7, 14, 36, 19, 68, 68, 83, 89, 179, 176, 439, 373, 414, 473, 839, 1010, 1577, 2271, 2848, 1762, 3376, 5913, 6795, 6352, 10319, 5866, 14639, 13303, 19439, 29982, 38956, 39323, 58857, 41646, 68371, 80754, 128859, 81453, 175734, 161438, 228543, 396274, 538797
Offset: 2

Views

Author

Martin Renner, Oct 20 2002, Sep 24 2007

Keywords

Crossrefs

Programs

  • Python
    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
        digits = 1
        while len(prime_lists) > 0:
            an += len(prime_lists)
            candidates = set((d,)+p for p in prime_lists for d in range(1, n))
            prime_lists = [c for c in candidates if isprime(fromdigits(c, n))]
            digits += 1
        return an
    print([a(n) for n in range(2, 27)]) # Michael S. Branicky, May 03 2022

A103443 Largest left-truncatable prime in base n (decimal expansion).

Original entry on oeis.org

23, 4091, 7817, 4836525320399, 817337, 14005650767869, 1676456897, 357686312646216567629137, 2276005673, 13092430647736190817303130065827539, 812751503, 615419590422100474355767356763
Offset: 3

Views

Author

Martin Renner, Mar 21 2005, Sep 24 2007, Apr 20 2008

Keywords

Crossrefs

Programs

  • PARI
    a(n)=my(v=primes(primepi(n-1)),u,t,b=1,best); while(#v, best=vecmax(v); b*=n; u=List(); for(i=1,#v,for(k=1,n-1,if(isprime(t=v[i]+k*b), listput(u,t)))); v=Vec(u)); best \\ Charles R Greathouse IV, Feb 05 2013

Extensions

Base-14 entry corrected by Hans Havermann, May 30 2011
Corresponding entry in a-file corrected by N. J. A. Sloane, Jun 02 2011
a-file corrected and expanded by Hans Havermann, Jan 25 2014

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

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];

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

A129940 Left truncatable primes in base 4 (written in decimal form).

Original entry on oeis.org

2, 3, 7, 11, 23, 43, 59, 107, 151, 251, 619, 919, 1019, 3067, 3691, 4091
Offset: 1

Views

Author

Martin Renner, Jun 09 2007

Keywords

Comments

There are 16 left truncatable primes in base 4.

Crossrefs

Extensions

Edited by Franklin T. Adams-Watters, Jan 25 2010

A129941 Left truncatable primes in base 5 (written in decimal form).

Original entry on oeis.org

2, 3, 7, 13, 17, 23, 67, 73, 107, 113, 317, 607, 613, 1567, 7817
Offset: 1

Views

Author

Martin Renner, Jun 09 2007

Keywords

Comments

There are a total number of 15 left truncatable primes in base 5.

Crossrefs

A129942 Left truncatable primes in base 6 (written in decimal form).

Original entry on oeis.org

2, 3, 5, 11, 17, 23, 29, 47, 53, 59, 83, 89, 101, 131, 137, 167, 173, 191, 197, 263
Offset: 1

Views

Author

Martin Renner, Jun 09 2007

Keywords

Comments

There is a total number of 454 left truncatable primes in base 6. Last term is a(454) = 4836525320399.

Crossrefs

A129943 Left truncatable primes in base 7 (written in decimal form).

Original entry on oeis.org

2, 3, 5, 17, 19, 23, 31, 37, 47, 227, 233, 311, 313, 317, 331, 919, 997, 2371, 2389, 10601, 111443, 817337
Offset: 1

Views

Author

Martin Renner, Jun 09 2007

Keywords

Comments

There are a total number of 22 left truncatable primes in base 7.

Crossrefs

Showing 1-10 of 13 results. Next