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 10 results.

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

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

A065821 a(n) is the smallest prime ending in exactly n 1's.

Original entry on oeis.org

31, 11, 2111, 101111, 311111, 29111111, 61111111, 1711111111, 14111111111, 31111111111, 311111111111, 2111111111111, 31111111111111, 3511111111111111, 5111111111111111, 101111111111111111, 3511111111111111111, 2111111111111111111, 1111111111111111111, 911111111111111111111
Offset: 1

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 23 2001

Keywords

Examples

			a(4) = 101111 because 1111=11*101, 21111=3*31*227, 31111=53*587, 41111=7^2*829, 51111=3^4*631, 61111=23*2657, 71111=17*47*89, 81111=3*19*1423, 91111=179*509 so 101111 is the first prime ending in four 1's.
		

Crossrefs

Programs

  • Mathematica
    pe[n_]:=Module[{k=0,len=IntegerLength[n]},While[Mod[k,10]==1||(!PrimeQ[ k*10^len+n]),k++];k*10^len+n]; pe/@Table[(10^n-1)/9,{n,20}] (* Harvey P. Dale, Dec 31 2013 *)_
  • PARI
    a(n)={ my(f=10^n, b=(f-1)/9, k=0); while (!isprime(b + k*f), k+=1+(k%10==0)); b + k*f } \\ Harry J. Smith, Nov 01 2009

Extensions

Edited and extended by Robert G. Wilson v, Jul 04 2003

A065580 Smallest prime ending in exactly n 3's.

Original entry on oeis.org

3, 233, 2333, 23333, 733333, 10333333, 83333333, 1033333333, 17333333333, 23333333333, 2633333333333, 10333333333333, 53333333333333, 3233333333333333, 1333333333333333, 23333333333333333, 2033333333333333333, 10333333333333333333, 173333333333333333333, 1733333333333333333333
Offset: 1

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[a = Table[3, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 3 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
  • PARI
    a(n)={ my(t=10^n, b=(t-1)/3, d=0); while (!isprime(b + t*d), d++; if(d%10==3, d++)); b + t*d } \\ Harry J. Smith, Oct 23 2009

A065581 Smallest prime ending in exactly n 7's.

Original entry on oeis.org

7, 277, 1777, 47777, 2477777, 16777777, 137777777, 577777777, 1777777777, 67777777777, 377777777777, 16777777777777, 17777777777777, 577777777777777, 2777777777777777, 157777777777777777, 377777777777777777, 2777777777777777777, 97777777777777777777, 2477777777777777777777
Offset: 1

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[a = Table[7, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 7 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
    k7[n_]:=Module[{c=FromDigits[PadRight[{},n,7]],k=0},While[Nand[PrimeQ[k*10^n + c], Mod[k, 10] != 7],k++];k*10^n+c]; Array[k7,20] (* Harvey P. Dale, Jan 29 2013 *)
  • PARI
    a(n)={ my(t=10^n, b=7*(t-1)/9, d=0); while (!isprime(b + t*d), d++; if(d%10==7, d++)); b + t*d } \\ Harry J. Smith, Oct 23 2009

A141311 Primes consisting of a digit and a nonempty string of 9's (i.e., primes of the form k*10^m - 1, where k is any digit).

Original entry on oeis.org

19, 29, 59, 79, 89, 199, 499, 599, 1999, 2999, 4999, 8999, 49999, 59999, 79999, 199999, 599999, 799999, 2999999, 4999999, 19999999, 29999999, 59999999, 89999999, 799999999, 59999999999, 79999999999, 59999999999999, 499999999999999, 29999999999999999999
Offset: 1

Views

Author

Lekraj Beedassy, Aug 02 2008

Keywords

Comments

k can never be 1, 4, or 7, because if it were, k*10^m - 1 would be divisible by 3.

Crossrefs

Programs

  • Mathematica
    d={9};s={};Do[Do[m=FromDigits[Join[IntegerDigits[i],d]];If[PrimeQ[m],AppendTo[s,m]],{i,8}];AppendTo[d,9],{j,19}];s (* James C. McMahon, Jul 20 2025 *)

Extensions

59999999 from Howard Berman (howard_berman(AT)hotmail.com), Apr 22 2009
Two more terms from Jon E. Schoenfield, Jan 12 2019

A120642 Smallest integer k>0 such that k*10^n - 1 is a prime.

Original entry on oeis.org

2, 2, 2, 5, 2, 3, 2, 8, 11, 6, 11, 35, 6, 5, 15, 14, 11, 21, 3, 21, 14, 6, 6, 80, 8, 2, 2, 6, 9, 48, 48, 21, 15, 6, 44, 11, 9, 15, 18, 6, 33, 30, 3, 278, 74, 92, 89, 33, 8, 71, 59, 11, 2, 5, 3, 24, 108, 47, 39, 41, 6, 14, 53, 173, 26, 26, 51, 114, 23, 17, 246, 44, 6, 131, 56, 8, 26, 77, 74
Offset: 1

Views

Author

Jonathan Vos Post, Aug 17 2006

Keywords

Examples

			The primes are 19, 199, 1999, 49999, 199999, 2999999,
19999999, 799999999, 10999999999, 59999999999, ...,.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ !PrimeQ[k*10^n - 1], k++ ]; k]; Array[f, 79] (* Robert G. Wilson v *)

Extensions

a(11) onwards from Robert G. Wilson v, Aug 20 2006

A120729 Smallest integer k>0 such that k*10^n + 1 is a semiprime.

Original entry on oeis.org

3, 2, 2, 5, 1, 1, 1, 1, 1, 2, 4, 2, 3, 7, 4, 3, 6, 6, 4, 1, 2, 4, 13, 2, 4, 3, 7, 21, 6, 9, 3, 1, 5, 4, 16, 19, 28, 19, 9, 3
Offset: 0

Views

Author

Jonathan Vos Post, Aug 17 2006

Keywords

Comments

The corresponding semiprimes are 4, 21, 201, 5001, 10001, 100001, 100001, 10000001, 2000000001, 40000000001, ... Semiprime analog of A121172.

Examples

			a(0) = 3 because 3*10^0 + 1 = 4 = 2^2 is a semiprime.
a(1) = 2 because 2*10^1 + 1 = 21 = 3*7 is a semiprime.
a(2) = 2 because 2*10^2 + 1 = 201 = 3*67 is a semiprime.
a(3) = 5 because 5*10^3 + 1 = 5001 = 3*1667 is a semiprime.
a(4) = 1 because 1*10^4 + 1 = 10001 = 73*137 is a semiprime.
a(5) = 1 because 1*10^5 + 1 = 100001 = 11*9091 is a semiprime.
		

Crossrefs

Programs

  • Mathematica
    sik[n_]:=Module[{k=1,c=10^n},While[PrimeOmega[k*c+1]!=2,k++];k]; Array[sik,40,0] (* Harvey P. Dale, Aug 20 2012 *)

Formula

Smallest integer k>0 such that k*10^n + 1 is in A001358.

Extensions

More terms from Harvey P. Dale, Aug 20 2012

A177688 Numbers n such that (n+2)//n - (n+1) is prime, where // represents the concatenation of decimals.

Original entry on oeis.org

0, 1, 4, 6, 7, 9, 12, 13, 15, 18, 19, 22, 25, 28, 31, 33, 39, 46, 48, 49, 52, 60, 61, 64, 67, 73, 75, 84, 85, 88, 90, 99, 100, 103, 106, 132, 133, 135, 136, 138, 142, 156, 160, 163, 171, 178, 181, 183, 187, 190, 198, 201, 202, 211, 220, 222, 229, 238, 241, 246, 252
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 11 2010

Keywords

Comments

If n is a k-digit number, then we demand that p = (n+2) * 10^k + n - (n+1) is a prime number, obviously of the form p = (n+2) * 10^k - 1, so the decimal representation of p is n+1 followed by k times the digit 9.
The sequence is infinite, proof with Dirichlet's prime number (in arithmetic progressions) theorem.
Note that numbers of the form (n+2)//n + (n+1) are multiples of 3 and do not generate primes.

Examples

			2//0 - 1 = 20 - 1 = 19 = prime(8), 0 is first term;
3//1 - 2 = 31 - 2 = 29 = prime(10), 1 is 2nd term;
6//4 - 5 = 64 - 5 = 59 = prime(17), 4 is 3rd term.
		

Crossrefs

Programs

  • Mathematica
    n2ncQ[n_]:=PrimeQ[FromDigits[Join[IntegerDigits[n+2], IntegerDigits[ n]]]- n-1]; Select[Range[0,300],n2ncQ]  (* Harvey P. Dale, Feb 24 2011 *)

A321363 Single-digit odd primes and primes whose decimal expansion has the form iii...ij, where i and j are distinct odd digits.

Original entry on oeis.org

3, 5, 7, 13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 113, 331, 337, 557, 773, 991, 997, 1117, 3331, 5557, 11113, 11117, 11119, 33331, 77773, 99991, 111119, 333331, 333337, 555557, 3333331, 9999991, 11111117, 11111119, 33333331, 55555553, 55555559, 111111113
Offset: 1

Views

Author

Enrique Navarrete, Nov 07 2018

Keywords

Crossrefs

Programs

  • Mathematica
    s={3, 5, 7}; Do[Do[Do[k=m*(10^n-1)/9*10+j; If[j!=m && PrimeQ[k], AppendTo[s, k]], {j,1,9,2}], {m,1,9,2}], {n,1,8}]; s (* Amiram Eldar, Nov 08 2018 *)
  • PARI
    lista(nn) = {print1("3, 5, 7, "); for (n=1, nn, r = (10^n-1)/9; forstep (i=1, 9, 2, forstep(j=1, 9, 2, if (i != j, if (isprime(p=fromdigits(concat(digits(r*i), j))), print1(p, ", "));););););} \\ Michel Marcus, Nov 28 2018

Extensions

a(35)-a(42) from Amiram Eldar, Nov 08 2018
Showing 1-10 of 10 results.