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

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

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

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

Showing 1-3 of 3 results.