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

A115062 Prime nearest to 10^n. In case of a tie, choose the smaller.

Original entry on oeis.org

2, 11, 101, 997, 10007, 100003, 1000003, 9999991, 100000007, 1000000007, 10000000019, 100000000003, 999999999989, 9999999999971, 99999999999973, 999999999999989, 10000000000000061, 99999999999999997, 1000000000000000003, 9999999999999999961
Offset: 0

Views

Author

Lekraj Beedassy, Mar 01 2006

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> (t->((p, q)->`if`(q-tAlois P. Heinz, Aug 13 2014
  • Mathematica
    Table[Min[Nearest[{NextPrime[10^n],NextPrime[10^n,-1]},10^n]],{n,0,20}] (* Harvey P. Dale, Mar 14 2023 *)
  • PARI
    for(n=0, 20, a=10^n-precprime(10^n); b=nextprime(10^n)-10^n; if(a<=b && n!=0, print1(precprime(10^n), ", "), print1(nextprime(10^n), ", "))) \\ Felix Fröhlich, Aug 13 2014

Formula

a(n) = 10^n + A117190(n).

Extensions

More terms from Giovanni Resta and Rick L. Shepherd, Mar 01 2006
Showing 1-1 of 1 results.