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.

A037069 Smallest prime containing exactly n 8's.

Original entry on oeis.org

2, 83, 881, 8887, 88883, 888887, 28888883, 88888883, 888888883, 48888888883, 288888888889, 888888888887, 48888888888883, 88888888888889, 888888888888883, 18888888888888883, 88888888888888889, 2888888888888888887, 8888888888888888881, 388888888888888888889
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

The last digit of n cannot be 8, therefore a(n) must have at least n+1 digits. It is probable (using [] for floor) that none among [10^n/9]*80 + {1,3,7,9} is prime in which case a(n) must have n+2 digits. We conjecture that for all n >= 0, a(n) equals [10^(n+1)/9]*80 + b with 1 <= b <= 9 and one of the (first) digits 8 replaced by a digit among {0, ..., 7}. - M. F. Hasler, Feb 22 2016

Crossrefs

Programs

  • Mathematica
    f[n_, b_] := Block[{k = 10^(n + 1), p = Permutations[ Join[ Table[b, {i, 1, n}], {x}]], c = Complement[Table[j, {j, 0, 9}], {b}], q = {}}, Do[q = Append[q, Replace[p, x -> c[[i]], 2]], {i, 1, 9}]; r = Min[ Select[ FromDigits /@ Flatten[q, 1], PrimeQ[ # ] & ]]; If[r ? Infinity, r, p = Permutations[ Join[ Table[ b, {i, 1, n}], {x, y}]]; q = {}; Do[q = Append[q, Replace[p, {x -> c[[i]], y -> c[[j]]}, 2]], {i, 1, 9}, {j, 1, 9}]; Min[ Select[ FromDigits /@ Flatten[q, 1], PrimeQ[ # ] & ]]]]; Table[ f[n, 8], {n, 1, 18}]
  • PARI
    A037069(n)={my(p, t=10^(n+1)\9*80); forvec(v=[[-1, n], [-8, -1]], nextprime(p=t+10^(n-v[1])*v[2])-p<10 && return(nextprime(p)))} \\ ~

Formula

a(n) = prime(A037068(n)). - Amiram Eldar, Jul 21 2025

Extensions

Corrected by Jud McCranie, Jan 04 2001
More terms from Erich Friedman, Jun 03 2001
More terms and a(0) = 2 from M. F. Hasler, Feb 22 2016

A065592 Smallest prime beginning with exactly n 9's.

Original entry on oeis.org

2, 97, 991, 99901, 99991, 9999901, 9999991, 999999929, 9999999929, 99999999907, 999999999937, 9999999999971, 99999999999923, 999999999999947, 9999999999999917, 99999999999999919, 99999999999999997, 9999999999999999919, 99999999999999999931
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    fp[n_]:=Select[Join[10*n+{1,7},100*n+Range[1,99,2]],PrimeQ,1]; With[{ns=Table[FromDigits[PadRight[{},n,9]],{n,20}]}, Join[{2}, Flatten[fp/@ns]]] (* Harvey P. Dale, May 12 2012 *)

Extensions

Corrected by Don Reble, Jan 17 2007
Offset corrected by Sean A. Irvine, Sep 06 2023

A065589 Smallest prime beginning with exactly n 6's.

Original entry on oeis.org

2, 61, 661, 6661, 666607, 666667, 66666629, 66666667, 666666667, 6666666661, 66666666667, 6666666666629, 66666666666629, 666666666666631, 66666666666666047, 66666666666666601, 6666666666666666059, 666666666666666661, 66666666666666666601, 66666666666666666667
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[a = Table[6, {n}]; k = 0; While[b = FromDigits[ Join[a, IntegerDigits[k] ]]; First[ IntegerDigits[k]] == 6 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
  • PARI
    a(n) = {if(n==0, return(2)); my(cs = 60*(10^n\9), pow10 = 10); for(i = 1, oo, np = cs; d = 0; while(d < pow10, np = nextprime(np + 1); d = np - cs; if(d < pow10 && digits(d)[1] != 6 || 10*d < pow10, return(np))); cs*=10; pow10*=10)} \\ David A. Corneth, Sep 06 2023

Extensions

Corrected by Don Reble, Jan 17 2007
Offset corrected by Sean A. Irvine, Sep 06 2023
Showing 1-3 of 3 results.