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.

A092245 Lesser of the first twin prime pair with n digits.

Original entry on oeis.org

3, 11, 101, 1019, 10007, 100151, 1000037, 10000139, 100000037, 1000000007, 10000000277, 100000000817, 1000000000061, 10000000001267, 100000000000097, 1000000000002371, 10000000000001549, 100000000000000019
Offset: 1

Views

Author

Cino Hilliard, Feb 17 2004

Keywords

Comments

Sum of reciprocals = 0.43523579465477...

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do
      r:= 10^(n-1);
      p:= nextprime(r); q:= nextprime(p);
      while q - p > 2 do
        p:= q; q:= nextprime(p);
      od;
      A[n]:= p;
    od:
    seq(A[n],n=1..100); # Robert Israel, Aug 04 2014
  • Mathematica
    a[n_] := Block[{p = NextPrime[10^(n -1)]}, While[ !PrimeQ[p +2], p = NextPrime@ p]; p]; Array[a, 18] (* Robert G. Wilson v, Dec 04 2022 *)
  • PARI
    firsttwpr(n) = { sr=0; for(m=0,n, c=0; for(x=10^m+1,10^(m+1), if(isprime(x)&& isprime(x+2),print1(x",");sr+=1./x;break) ) ); print(); print(sr) }
    
  • Python
    import sympy
    for i in range(100):
        p=sympy.nextprime(10**i)
        while not sympy.isprime(p+2):
            p=sympy.nextprime(p)
        print(p)
    # Abhiram R Devesh, Aug 02 2014

Formula

a(n) = A124001(n-1) + 10^(n-1). - Robert G. Wilson v, Nov 28 2015

Extensions

Corrected by T. D. Noe, Nov 15 2006