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

A064490 Smallest prime with prime(n) decimal digits.

Original entry on oeis.org

11, 101, 10007, 1000003, 10000000019, 1000000000039, 10000000000000061, 1000000000000000003, 10000000000000000000009, 10000000000000000000000000331, 1000000000000000000000000000057, 1000000000000000000000000000000000067, 10000000000000000000000000000000000000121
Offset: 1

Views

Author

Jason Earls, Oct 04 2001

Keywords

Examples

			11 is the first prime with 2 decimal digits.
101 is the first prime with 3 decimal digits.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 20 do p := ithprime(n): for i from 10^(p-1) to 10^p do if isprime(i) then printf(`%d,`,i); break; fi: od: od:
    # second Maple program:
    a:= n-> nextprime(10^(ithprime(n)-1)):
    seq(a(n), n=1..15);  # Alois P. Heinz, Jun 24 2018
  • Mathematica
    Table[NextPrime[10^(n-1)],{n,Prime[Range[15]]}] (* Harvey P. Dale, Feb 06 2020 *)
  • PARI
    l(n)=ln=0; while(n,n=floor(n/10); ln++); return(ln);
    a=0; for(n=1,10^6,x=l(prime(n)); if(isprime(x),b=x; if(b>a,a=b; print(prime(n)))))
    
  • PARI
    { for (n=1, 75, p=prime(n); a=nextprime(10^(p - 1)); write("b064490.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 16 2009
    
  • Python
    from sympy import prime, nextprime, primepi
    def a(n): return nextprime(10**(prime(n)-1))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, May 26 2021

Formula

a(n) = A003617(A000040(n)).
a(n) = A000040(A064489(n)).

Extensions

More terms from James Sellers, Oct 08 2001
Offset changed from 0 to 1 by Harry J. Smith, Sep 16 2009

A126712 Height of steps in Recamán's sequence A064389.

Original entry on oeis.org

0, 1, 1, 4, 4, 2, 2, 3, 3, 3, 3, 3, 3, 7, 5, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 7, 5, 5, 5, 11, 11, 11, 11, 11, 11, 5, 11, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 6, 6, 11, 9, 9, 6, 6, 11, 8, 8, 8, 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

R. J. Mathar, Feb 12 2007

Keywords

Examples

			The heights to reach 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24 in A064389 are b(1,2,3,...) = 0, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5 etc., as defined by b(n) = b(n-1) + sign(A064389(n) - A064389(n-1)).
Reshuffling sequence b while sorting A064489 into A078758 produces sequence a here, a(n) = b(A078758(n)).
		

Crossrefs

Programs

  • Maple
    A064389 := proc(nmax) local a,n,adiff,newa ; a := [1] ; for n from 2 to nmax do adiff := n ; while true do newa := op(-1,a)-adiff ; if newa >0 and not newa in a then a := [op(a),newa] ; break ; fi ; newa := op(-1,a)+adiff ; if newa >0 and not newa in a then a := [op(a),newa] ; break ; fi ; adiff := adiff+1 ; od ; od ; RETURN(a) ; end: A064389b := proc(a) local n,hei ; hei := [0] ; for n from 2 to nops(a) do hei := [op(hei),op(-1,hei)+sign(op(n,a)-op(n-1,a))] ; od ; RETURN(hei) ; end: inList := proc(list,n) local i ; for i from 1 to nops(list) do if op(i,list) = n then RETURN(i) ; fi ; od ; RETURN(-1) ; end: A078758 := proc(a064389) local a,n,i ; a := [] ; n :=1 ; while true do i := inList(a064389,n) ; if i < 0 then RETURN(a) ; else a := [op(a),i] ; n := n+1 ; fi ; od ; end: nmax := 1800 : a064389 := A064389(nmax) : a078758 := A078758(a064389) : b := A064389b(a064389) : for n from 1 to nops(a078758) do printf("%d, ",op(op(n,a078758),b)) ; od;
Showing 1-2 of 2 results.