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.

Previous Showing 11-20 of 21 results. Next

A037065 Smallest prime containing exactly n 6's.

Original entry on oeis.org

2, 61, 661, 6661, 166667, 666667, 16666669, 66666667, 666666667, 6666666661, 66666666667, 1666666666661, 36666666666661, 166666666666667, 3666666666666667, 16666666666666661, 616666666666666661, 666666666666666661, 36666666666666666661, 66666666666666666667
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

Note that a(11) is palindromic.
The last digit of n cannot be 6, therefore a(n) must have at least n+1 digits. It is probable that none among [10^n/9]*60 + {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]*60 + b with 1 <= b <= 9 and one of the (first) digits 6 replaced by a digit among {0, 1, 2, 3, 4, 5}. - 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, 6], {n, 1, 17}]
  • PARI
    A037065(n)={my(p, t=10^(n+1)\9*60); forvec(v=[[-1, n], [-6, -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(A037064(n)). - Amiram Eldar, Jul 21 2025

Extensions

More terms from Hans Havermann, Jun 16 2001
More terms and a(0) = 2 from M. F. Hasler, Feb 22 2016

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

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

A037052 a(n)-th prime is the smallest prime containing exactly n 0's.

Original entry on oeis.org

1, 26, 169, 1230, 9593, 78499, 1270608, 5761456, 50847535, 1300005927, 4118054814, 73301896140, 1320811971703, 29844570422670, 169969662554552, 547863431950009, 2623557157654234, 24739954287740861, 1347790196060095448, 10720710117789005898, 161902001837504830334
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Crossrefs

Programs

  • Mathematica
    (* see A037053 for f *) PrimePi[ Table[ f[n], {n, 1, 12}]]

Formula

a(n) = A000720(A037053(n)). - Daniel Suteu, Aug 08 2019

Extensions

Edited and extended by Robert G. Wilson v, Jul 04 2003
a(0) = 1 inserted and a(13)-a(17) added by Daniel Suteu, Aug 08 2019
a(18)-a(20) calculated using Kim Walisch's primecount and added by Amiram Eldar, Sep 03 2024

A269260 For index k = A269230(n), the least prime with k consecutive digits 0, divided by 10^(k+1) and rounded down.

Original entry on oeis.org

19, 10, 16, 16, 20, 30, 20, 15, 30, 26, 23, 27, 19, 17, 40, 30, 13, 13, 13, 24, 28, 22, 20, 10, 20, 30, 16, 10, 40, 13, 16, 11, 39, 10, 20, 20, 30, 10, 23, 16, 15, 30, 34, 56, 19, 28, 20, 20, 30, 20, 20, 90, 87, 68, 20, 25, 20, 16, 30, 40
Offset: 1

Views

Author

M. F. Hasler, Feb 22 2016

Keywords

Comments

For indices k not listed in A269230, the least prime with k digits '0', A037053(k), has these digits consecutively, in a single run. If k is listed in A269230, this is not the case (e.g., A037053(32) = 10...0603), and the most economical way to make a prime with k consecutive digits 0 is to put two (a priori nonzero) digits in front of the string of k '0's, i.e., p = a*10^(k+1) + b with a > 9.
This sequence lists these numbers a, and the corresponding prime (least prime with k consecutive digits 0) is simply nextprime(a*10^(k+1)).
If a is a multiple of 10, then b can have two nonzero digits, 11 <= b <= 99. Otherwise (b < 10), this prime is also the least prime with k+1 (consecutive) digits '0', A037053(k+1), and k+1 is listed in A085824 (unless a > 90). It is then obviously not the smallest prime with *exactly* k consecutive digits 0, but with *at least* k consecutive digits 0. This happens for (n,k,a,b) = (2,43,10,9), (24,108,10,7), (28,121,10,3), (34,132,10,7), (38,144,10,9), ...

Programs

  • PARI
    A269260(n,k=A269230(n))=for(a=1,9e9,nextprime(a*10^(k+1))-a*10^(k+1)<10^(valuation(a,10)+1)&&return(a)) \\ If the 2nd (optional) arg is given, the 1st arg 'n' is ignored. Otherwise the function A269230() must be defined.

A139535 Smallest prime starting with 1 that contains exactly n 0's.

Original entry on oeis.org

101, 1009, 10007, 100003, 1000003, 100000037, 100000007, 1000000007, 100000000019, 100000000003, 10000000000037, 100000000000031, 1000000000000037, 10000000000000061, 100000000000000013
Offset: 1

Views

Author

Lekraj Beedassy, Apr 25 2008

Keywords

Crossrefs

Programs

  • Mathematica
    sp0[n_]:=Module[{c=1,d},While[d=FromDigits[Join[PadRight[{1},n+1,0],IntegerDigits[ c]]];DigitCount[d,10,0]>n||CompositeQ[d],c=c+2];FromDigits[ Join[ PadRight[ {1},n+1,0],IntegerDigits[c]]]]; Array[sp0,20] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 30 2020 *)

A176096 Smallest prime p = p(n) containing exactly n strings "13" (n = 1, 2, ...).

Original entry on oeis.org

13, 13313, 1313813, 131313113, 13131313133, 1131313131313, 131313131313139, 13131313131313913, 1313131311313131313, 113131313131313131313, 13131313131313133131313, 1313131131313131313131313
Offset: 1

Views

Author

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

Keywords

Examples

			n = 1: prime(6) = 13 is 1st term of sequence
prime(12268) = 131303 > 21313 = prime(2392) > 13313 = prime(1581) = p(2), 2nd term of sequence
prime(857198) = 13131317 > 4131313 = prime(291796) > prime(102949) = 1341313 > 1313813 = prime() = p(3), 3rd term of sequence
n = 13: 131131313131313131313131313 a 27-digit prime is 13th term of sequence
		

References

  • E. I. Ignatjew, Mathematische Spielereien, Urania Verlag Leipzig/Jena/Berlin 1982
  • B. A. Kordemski: Koepfchen, Koepfchen! Mathematik zur Unterhaltung, Urania Verlag Leipzig/Jena/Berlin 1965

Crossrefs

A300102 Smallest prime containing exactly n consecutive 0's.

Original entry on oeis.org

2, 101, 1009, 10007, 100003, 1000003, 20000003, 100000007, 1000000007, 30000000001, 100000000003, 2000000000003, 40000000000001, 1000000000000037, 6000000000000001, 20000000000000003, 100000000000000003, 1000000000000000003, 60000000000000000007, 500000000000000000003
Offset: 0

Views

Author

Chai Wah Wu, Feb 25 2018

Keywords

Comments

Sequence agrees with A037053 up to a(31) (see comment in A037053). A269230 lists indices where these 2 sequences differ.
For the first 1001 terms of this sequence, the number of nonzero digits of each term is 4 or less. This differs from A037053 for which the number of nonzero digits is 3 or less for the first 12000 terms. Does there exist n such that a(n) has 5 or more nonzero digits?
a(n) has 3 nonzero digits for n = 13, 22, 29, 31, 32, 33, 40, 42, 43, ...
a(n) has 4 nonzero digits for n = 192, 213, 238, 250, 252, 257, 268, 293, 297, 303, ...
a(n) <> A037053(n) and a(n) = A037053(m) for some m > n for n = 436, 780, 845, 866, 894, 911, 945, 957, 967, ... In all these cases so far, a(n) has n+1 zero digits. Are there n satisfying these conditions such that a(n) has more than n+1 zero digits?
Sequence is not monotonically increasing; indices for which a(n) > a(n+1) are 22, 43, 47, 58, 67, 105, 108, 121, 132, 144, 192, 220, 238, 250, 252, 257, 261, 270, ...

Crossrefs

A375760 Array read by rows: T(n,k) is the first prime with exactly n occurrences of decimal digit k.

Original entry on oeis.org

2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 101, 13, 2, 3, 41, 5, 61, 7, 83, 19, 1009, 11, 223, 233, 443, 557, 661, 277, 881, 199, 10007, 1117, 2221, 2333, 4441, 5557, 6661, 1777, 8887, 1999, 100003, 10111, 22229, 23333, 44449, 155557, 166667, 47777, 88883, 49999, 1000003, 101111, 1222229, 313333, 444443, 555557, 666667, 727777, 888887, 199999
Offset: 0

Views

Author

Robert Israel, Aug 27 2024

Keywords

Examples

			T(4,1) = 10111 because 10111 is the first prime with four 1's.
Array starts
      2      2       3      2      2      2      2      2      2      2
    101     13       2      3     41      5     61      7     83     19
   1009     11     223    233    443    557    661    277    881    199
  10007   1117    2221   2333   4441   5557   6661   1777   8887   1999
 100003  10111   22229  23333  44449 155557 166667  47777  88883  49999
1000003 101111 1222229 313333 444443 555557 666667 727777 888887 199999
		

Crossrefs

Programs

  • Maple
    F:= proc(v,x) local d,y,z,L,S,SS,Cands,t,i,k;
       for d from v do
         Cands:= NULL;
         if x = 0 then SS:= combinat:-choose([$2..d-1],v)
         elif member(x,[1,3,7,9]) then SS:= combinat:-choose(d,v)
         else SS:= combinat:-choose([$2..d],v)
         fi;
         for S in SS do
           for y from 9^(d-v+1) to 9^(d-v+1)+9^(d-v)-1 do
             L:= convert(y,base,9)[1..d-v+1];
             L:= map(proc(s) if s < x then s else s+1 fi end proc, L);
             i:= 1;
             t:= 0:
             for k from 1 to d do
               if member(k,S) then t:= t + x*10^(k-1)
               else t:= t + L[i]*10^(k-1); i:= i+1;
               fi;
             od;
             Cands:= Cands, t
         od od;
         Cands:= sort([Cands]);
         for t in Cands do if isprime(t) then return t fi od;
       od
    end proc:
    F(0,0):= 2: F(1,2):= 2: F(1,5):= 5:
    for i from 0 to 10 do
      seq(F(i,x), x=0..9)
    od;
  • Mathematica
    T[n_,k_]:=Module[{p=2},While[Count[IntegerDigits[p],k]!=n, p=NextPrime[p]]; p]; Table[T[n,k],{n,0,5},{k,0,9}]//Flatten (* Stefano Spezia, Aug 27 2024 *)

A270095 Numbers n for which A269233(n) is a record.

Original entry on oeis.org

0, 2, 6, 9, 12, 13, 22, 31, 32, 50, 73, 78, 123, 136, 147, 232, 248, 306, 323, 356, 396, 403, 435, 575, 684, 723, 802, 808, 909, 962, 1165, 1684, 1820, 2051, 2202, 2219, 2683, 2746, 3580, 4109, 4158, 4450, 4770
Offset: 1

Views

Author

Hans Havermann, Mar 10 2016

Keywords

Examples

			0 is in the list because A269233(0)=0 is initial.
2 is in the list because A269233(2)=3 is the first value greater than A269233(0)=0.
6 is in the list because A269233(6)=5 is the first value greater than A269233(2)=3.
9 is in the list because A269233(9)=8 is the first value greater than A269233(6)=5.
		

Crossrefs

Previous Showing 11-20 of 21 results. Next