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.

A037061 Smallest prime containing exactly n 4's.

Original entry on oeis.org

2, 41, 443, 4441, 44449, 444443, 24444443, 424444441, 444444443, 4444444447, 44444444441, 444444444443, 14444444444449, 440444444444441, 2444444444444447, 44044444444444441, 424444444444444447, 4344444444444444449, 42444444444444444443, 44444444444444444447
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

The last digit of n cannot be 4, therefore a(n) must have at least n+1 digits. It is probable that none among [10^n/9]*40 + {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]*40 + b with 1 <= b <= 9 and one of the (first) digits 4 replaced by a 0, 1, 2 or 3. - 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, 4], {n, 1, 18}]
  • PARI
    A037061(n)={my(p, t=10^(n+1)\9*40); forvec(v=[[-1, n], [-4, -1]], nextprime(p=t+10^(n-v[1])*v[2])-p<10 && return(nextprime(p)))} \\ M. F. Hasler, Feb 22 2016

Formula

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

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 23 2003
More terms and a(0) = 2 from M. F. Hasler, Feb 22 2016

A068105 Smallest prime starting with n 5s.

Original entry on oeis.org

2, 5, 557, 5557, 555521, 555557, 55555517, 55555553, 5555555501, 5555555557, 555555555551, 555555555551, 5555555555551, 555555555555529, 555555555555557, 55555555555555519, 555555555555555559, 555555555555555559, 55555555555555555567, 5555555555555555555087
Offset: 0

Views

Author

Amarnath Murthy, Feb 20 2002

Keywords

Crossrefs

Programs

  • Python
    from sympy import isprime
    def a(n):
      if n < 2: return list([2, 5])[n]
      n5s, i, pow10 = int('5'*n), 1, 1
      while True:
        i = 1
        while i < pow10:
          t = n5s * pow10 + i
          if isprime(t): return t
          i += 2
        pow10 *= 10
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 05 2021

Formula

a(n) <= A065588(n). - Michael S. Branicky, Feb 05 2021

Extensions

Edited and extended by Robert G. Wilson v, Feb 21 2002
Corrected by Don Reble, Jan 17 2007

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.