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-10 of 11 results. Next

A037071 Smallest prime containing exactly n 9's.

Original entry on oeis.org

2, 19, 199, 1999, 49999, 199999, 2999999, 19999999, 799999999, 9199999999, 59999999999, 959999999999, 9919999999999, 59999999999999, 499999999999999, 9299999999999999, 99919999999999999, 994999999999999999, 9991999999999999999, 29999999999999999999, 989999999999999999999
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

We conjecture that for all n >= 0, a(n) equals [10^(n+1)/9]*9 with one of the (first) digits 9 replaced by a digit among {1, 2, 4, 5, 7, 8}. - 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, 9], {n, 1, 20}]
  • PARI
    A037071(n)={my(t=10^(n+1)\9*9); forvec(v=[[-1, n], [-8, -1]], ispseudoprime(p=t+10^(n-v[1])*v[2]) && return(p));error} \\ M. F. Hasler, Feb 22 2016

Formula

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

Extensions

More terms from Vladeta Jovovic, Jan 10 2002
a(0) = 2 prepended by M. F. Hasler, Feb 22 2016

A065582 Smallest prime ending in exactly n 9's.

Original entry on oeis.org

19, 199, 1999, 49999, 199999, 2999999, 19999999, 799999999, 10999999999, 59999999999, 1099999999999, 34999999999999, 59999999999999, 499999999999999, 14999999999999999, 139999999999999999, 1099999999999999999, 20999999999999999999, 29999999999999999999, 2099999999999999999999
Offset: 1

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Comments

From Jeppe Stig Nielsen, Jul 30 2022: (Start)
Can decrease, for example a(25) < a(24). So not the same as Smallest prime ending in n or more 9s.
a(n) can contain other 9s as well, for example a(46), a(118), a(156). (End)

Crossrefs

Programs

  • Mathematica
    Do[a = Table[9, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 9 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
  • PARI
    a(n)={ my(t=10^n, b=t-1, d=0); while(!isprime(b + t*d), d++; if(d%10==9, d++)); b + t*d } \\ Harry J. Smith, Oct 23 2009
    
  • Python
    from sympy import isprime
    def a(n):
        pow, end, i = 10**n, 10**n-1, 1
        while i%10 == 9 or not isprime(i*pow + end): i += 1
        return i*pow + end
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Jul 30 2022

A065585 Smallest prime beginning with exactly n 2's.

Original entry on oeis.org

3, 2, 223, 2221, 22229, 2222203, 22222253, 22222223, 222222227, 22222222273, 22222222223, 2222222222243, 22222222222201, 22222222222229, 222222222222227, 222222222222222043, 222222222222222281, 222222222222222221, 22222222222222222253, 222222222222222222277
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

A068103 is a lower bound, but most often equality holds. - M. F. Hasler, Oct 17 2012

Programs

  • Mathematica
    Do[a = Table[2, {n}]; k = 0; While[b = FromDigits[ Join[a, IntegerDigits[k] ]]; First[ IntegerDigits[k]] == 2 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
  • PARI
    A065585(n)={n=10^n\9*2; n>2&for(d=1, 9e9, n*=10; for(t=1, 10^d-1, t\10^(d-1)==2 & t+= 10^(d-1)+(t>2); ispseudoprime(n+t) & return(n+t))); 2+!n} \\ M. F. Hasler, Oct 17 2012
    
  • Python
    from sympy import isprime
    def a(n):
      if n < 2: return list([3, 2])[n]
      n2s, i, pow10, end_digits = int('2'*n), 1, 1, 0
      while True:
        i = 1
        while i < pow10:
          istr = str(i)
          if istr[0] == '2' and len(istr) == end_digits:
            i += pow10 // 10
          else:
            t = n2s * pow10 + i
            if isprime(t): return t
            i += 2
        pow10 *= 10; end_digits += 1
    print([a(n) for n in range(20)]) # Michael S. Branicky, Mar 02 2021

Extensions

Corrected by Don Reble, Jan 17 2007

A065586 Smallest prime beginning with exactly n 3's.

Original entry on oeis.org

2, 3, 331, 3331, 33331, 333331, 3333331, 33333331, 3333333319, 33333333329, 333333333323, 3333333333301, 33333333333319, 333333333333307, 3333333333333301, 33333333333333323, 333333333333333391, 333333333333333331, 33333333333333333359, 3333333333333333333041
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Extensions

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

A065480 Decimal expansion of Product_{p prime} (1 - 1/(p^2+p-1)).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 19 2001

Keywords

Comments

The probability that two numbers are coprime given that they are both coprime to a randomly chosen third number. - Luke Palmer, Apr 27 2019

Examples

			0.6695802905390623676350256956124342...
		

Crossrefs

Programs

  • Mathematica
    digits = 98; Exp[NSum[(1/2)*(-2 + (-2)^n - ((1/2)*(-1 - Sqrt[5]))^n*(-1 + Sqrt[5]) + ((1/2)*(-1 + Sqrt[5]))^n*(1 + Sqrt[5]))*PrimeZetaP[n - 1]/(n - 1), {n, 3, Infinity}, WorkingPrecision -> 4 digits, Method -> "AlternatingSigns"]] // RealDigits[#, 10, digits]& // First (* Jean-François Alcover, Apr 18 2016 *)
  • PARI
    prodeulerrat(1 - 1/(p^2+p-1)) \\ Amiram Eldar, Mar 14 2021

Formula

Equals A065473*zeta(2)/A065463. - Luke Palmer, Apr 27 2019

A065587 Smallest prime beginning with exactly n 4's.

Original entry on oeis.org

2, 41, 443, 4441, 44449, 444443, 44444453, 444444421, 444444443, 4444444447, 44444444441, 444444444443, 44444444444459, 444444444444421, 4444444444444423, 44444444444444411, 444444444444444413, 4444444444444444409, 44444444444444444479, 44444444444444444447
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Extensions

Offset corrected by Sean A. Irvine, Sep 06 2023

A065588 Smallest prime beginning with exactly n 5's.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Cf. A037063, A065584 - A065592. Different from A068105.

Programs

  • Python
    from sympy import isprime
    def a(n):
      if n < 2: return list([2, 5])[n]
      n5s, i, pow10, end_digits = int('5'*n), 1, 1, 0
      while True:
        i = 1
        while i < pow10:
          istr = str(i)
          if istr[0] == '5' and len(istr) == end_digits:
            i += 2 if pow10 <= 10 else pow10 // 10
          else:
            t = n5s * pow10 + i
            if isprime(t): return t
            i += 2
        pow10 *= 10; end_digits += 1
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 05 2021, corrected Mar 03 2021

Extensions

Corrected by N. J. A. Sloane, Jan 11 2007 and by Don Reble, Jan 17 2007
Offset corrected by Michael S. Branicky, Feb 05 2021

A065590 Smallest prime beginning with exactly n 7's.

Original entry on oeis.org

2, 7, 773, 77711, 77773, 7777709, 77777719, 777777701, 777777773, 77777777717, 777777777713, 777777777773, 7777777777771, 777777777777719, 777777777777773, 77777777777777711, 777777777777777737, 7777777777777777793, 77777777777777777729, 77777777777777777771
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Extensions

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

A065591 Smallest prime beginning with exactly n 8's.

Original entry on oeis.org

2, 83, 881, 8887, 88883, 888887, 88888817, 88888883, 888888883, 88888888801, 888888888859, 888888888887, 88888888888873, 88888888888889, 888888888888883, 88888888888888801, 88888888888888889, 8888888888888888813, 8888888888888888881, 888888888888888888857
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

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-10 of 11 results. Next