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

A037057 Smallest prime containing exactly n 2's.

Original entry on oeis.org

3, 2, 223, 2221, 22229, 1222229, 20222227, 22222223, 222222227, 20222222221, 22222222223, 2122222222229, 21222222222221, 22222222222229, 222222222222227, 21222222222222221, 202222222222222229, 222222222222222221, 22222202222222222221, 220222222222222222229, 2202222222222222222229
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

For n > 1, the last digit cannot be 2, so a(n) has at least n+1 digits. The probability is big that none of [10^n/9]*20 + {1,3,7,9} is prime, in which case a(n) must have at least n+2 digits. This is the most frequent case. We can even conjecture that for all n > 1, a(n) equals [10^(n+1)/9]*20 + b with 1 <= b <= 9 and one of the (first) digits 2 replaced by 0 or 1. - 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, 2], {n, 1, 18}]
  • PARI
    A037057(n)={my(p,t=10^(n+1)\9*20); n>1 && forvec(v=[[-1,n],[-2,-1]],nextprime(p=t+10^(n-v[1])*v[2])-p<10 && return(nextprime(p)));3-n} \\ M. F. Hasler, Feb 22 2016

Formula

a(n) = prime(A037056(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) = 3 from M. F. Hasler, Feb 22 2016

A068103 Smallest prime starting with at least n 2s.

Original entry on oeis.org

2, 2, 223, 2221, 22229, 2222203, 22222223, 22222223, 222222227, 22222222223, 22222222223, 2222222222243, 22222222222201, 22222222222229, 222222222222227, 222222222222222043, 222222222222222221
Offset: 0

Views

Author

Amarnath Murthy, Feb 20 2002

Keywords

Crossrefs

Programs

  • PARI
    A068103(n)={n=10^n\9*2;n>2&for(d=1,9e9,n*=10;for(t=1,10^d-1,ispseudoprime(n+t)&return(n+t)));2} \\ - M. F. Hasler, Oct 17 2012

Extensions

More terms from Sascha Kurz, Mar 19 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

A176119 Smallest prime p = p(n) beginning with exactly n strings "13". (n = 1, 2, ...).

Original entry on oeis.org

13, 131303, 13131317, 131313137, 13131313133, 13131313131329, 131313131313139, 1313131313131313083, 13131313131313131331, 1313131313131313131333, 131313131313131313131363
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 09 2010

Keywords

Comments

See references of A176096
List of appendices:
for 1st term p(1) = 13: ./., 03, 17, 7, 3, 29, 9, 083, 31, 33, 63, 1, 01, 09, 19, 31, 71, 139, 9, 107, 149

Examples

			n = 1: prime(6) = 13 is 1st term of sequence
n = 2: prime(12268) = 131303 is 2nd term of sequence
n = 12: p(12) is first such palindromic prime (i.e. appendix 1)
Curious: (13)_18//139 = p(18) = p(19) = (13)_19//9
		

Crossrefs

A176183 Smallest prime p = p(n) ending with exactly n strings "13".

Original entry on oeis.org

13, 21313, 4131313, 1213131313, 81313131313, 1131313131313, 613131313131313, 21313131313131313, 8131313131313131313, 113131313131313131313, 171313131313131313131313, 23131313131313131313131313
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 11 2010

Keywords

Comments

See references of A176096.
List of prefixes: for 1st term p(1) = 13: ./., 2, 4, 12, 8, 1, 6, 2, 8, 1, 17, 23, 21, 8, 59, 87, 53, 46, 10, 8, 20, 73, 29, 20, 3, 2, 16, 33, 80, 2, ...

Examples

			n = 1: prime(6) = 13 is 1st term of sequence.
n = 2: prime(2392) = 21313 is 2nd term of sequence.
Note: 1st such palindromic prime (i.e. prefix 3): p(25) = 3(13)_25 = 313131313131313131313131313131313131313131313131313.
		

Crossrefs

Showing 1-5 of 5 results.