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 14 results. Next

A003618 Largest n-digit prime.

Original entry on oeis.org

7, 97, 997, 9973, 99991, 999983, 9999991, 99999989, 999999937, 9999999967, 99999999977, 999999999989, 9999999999971, 99999999999973, 999999999999989, 9999999999999937, 99999999999999997, 999999999999999989, 9999999999999999961, 99999999999999999989
Offset: 1

Views

Author

Keywords

Comments

Since 10^n - 1 is always a multiple of 9, one could be tempted to think that 9 is the least frequently occurring least significant digit in terms of this sequence. - Alonso del Arte, Dec 03 2017
The occurrences of least significant digits in the first 8000 terms (see A033874) are 1: 2028, 3: 2032, 7: 2014, and 9: 1926. - Giovanni Resta, Mar 16 2020

Examples

			No power of 10 is prime.
9 = 3^2, 8 = 2^3 but 7 is prime, so a(1) = 7.
99 = 3^2 * 11 but 97 is prime, so a(2) = 97.
999 = 3^3 * 37 but 997 is prime, so a(3) = 997.
9999 = 3^2 * 11 * 101, 9997 = 13 * 769, 9995 = 5 * 1999, 9993 = 3 * 3331, 9991 = 97 * 103, ..., 9975 = 5^2 * 399, but 9973 is prime, so a(4) = 9973.
		

References

  • O'Hara, J. Rec. Math., 22 (1990), Table on page 278.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003617, A033874, A114429 (largest n-digit twin prime).

Programs

Extensions

More terms from Stefan Steinerberger, Apr 08 2006

A033873 Difference between first prime > 10^n (A003617) and 10^n.

Original entry on oeis.org

1, 1, 1, 9, 7, 3, 3, 19, 7, 7, 19, 3, 39, 37, 31, 37, 61, 3, 3, 51, 39, 117, 9, 117, 7, 13, 67, 103, 331, 319, 57, 33, 49, 61, 193, 69, 67, 43, 133, 3, 121, 109, 63, 57, 31, 9, 121, 33, 193, 9, 151, 121, 327, 171, 31, 21, 3, 279, 159, 19, 7, 93, 447, 121, 57, 49, 49, 49, 99, 9
Offset: 0

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net)

Keywords

Examples

			The 23rd term is 117 since 10^23 + 117 = 100000000000000000000117 is prime and all of 100000000.., 100000....001, 1000...002 up through 1000...000116 are composite.
		

References

  • O'Hara, J. Rec. Math., 22 (1990), Table on page 278.

Crossrefs

Programs

Formula

a(n) = A003617(n) - 10^n = A013632(10^n). - Robert Israel, Aug 10 2015

Extensions

More terms from Patrick De Geest

A179975 Smallest k such that k*10^n is a sum of two successive primes.

Original entry on oeis.org

5, 3, 1, 6, 6, 6, 14, 6, 9, 19, 21, 21, 42, 93, 21, 6, 11, 2, 12, 111, 37, 39, 63, 38, 42, 24, 15, 15, 60, 6, 39, 82, 47, 58, 337, 49, 72, 25, 34, 21, 6, 107, 128, 96, 20, 2, 63, 231, 70, 7, 62, 144, 28, 151, 157, 33, 98, 55, 134, 162, 87, 201, 124, 303, 64, 106, 130, 13, 43
Offset: 0

Views

Author

Zak Seidov, Aug 04 2010

Keywords

Comments

From Robert G. Wilson v, Aug 11 2010: (Start)
A179975 n's such that a(n)=1: 3, 335, ..., .
A179975 First occurrence of k: 3, 18, 2, ???, 1, 4, 50, 162, 9, 335, 17, 19, 68, 7, 27, ..., .
Records: 5, 6, 14, 19, 21, 42, 93, 111, 337, 449, 862, 1049, 1062, 1122, 1280, 2278, 3168, 4290, ..., . (End)

Examples

			a(0)=5 because 5=2+3
a(1)=3 because 30=13+17
a(2)=1 because 100=47+53
a(3)=6 because 6000=2999+3001.
		

Crossrefs

Programs

  • Mathematica
    Join[{5,3},Reap[Do[Do[n=10^m k; If[n==PreviousPrime[n/2]+NextPrime[n/2],Sow[k];Break[]],{k,2000}],{m,2,50}]][[2,1]]]
    f[n_] := Block[{k = 1, tn = 10^n}, While[h = k*tn/2; NextPrime[h, -1] + NextPrime@h != k*tn, k++ ]; k]; f[1] = 3; Array[f, 70, 0] (* Robert G. Wilson v, Aug 11 2010 *)

Extensions

More terms from Robert G. Wilson v, Aug 11 2010

A038804 Difference between largest n-digit prime and smallest (n+1)-digit prime.

Original entry on oeis.org

4, 4, 12, 34, 12, 20, 28, 18, 70, 52, 26, 50, 66, 58, 48, 124, 6, 14, 90, 50, 218, 36, 140, 264, 136, 208, 202, 540, 346, 68, 60, 70, 70, 604, 92, 226, 124, 192, 60, 138, 228, 146, 138, 84, 18, 154, 74, 226, 66, 208, 444, 558, 348, 322, 132, 596, 372, 308, 160, 168
Offset: 1

Views

Author

Keywords

Comments

Records: 4, 12, 34, 70, 124, 218, 264, 540, 604, 670, 754, 1182, ..., . - Robert G. Wilson v, Jan 23 2020

Examples

			7 = greatest prime with 1 digit, 11 next smallest prime with 2 digits so a(1)=4.
97 = greatest prime with 2 digits, 101 next smallest prime with 3 digits so a(2)=4.
		

Crossrefs

Programs

  • Mathematica
    (NextPrime[#]-NextPrime[#,-1])&/@(10^Range[100])  (* Harvey P. Dale, Mar 23 2011 *)

Formula

a(n) = A033873(n) + A033874(n). - Zak Seidov, Sep 13 2016

Extensions

Corrected and edited by Patrick De Geest, Nov 06 2004

A350826 Number of prime sextuplets with n-digit initial term (A022008).

Original entry on oeis.org

1, 1, 0, 0, 3, 0, 13, 64, 235, 1296, 7013, 41782, 253420, 1607418, 10520883, 70785653, 488096844
Offset: 1

Views

Author

M. F. Hasler, Jan 17 2022

Keywords

Comments

Prime sextuplets are of the form (p, p+4, p+6, p+10, p+12, p+16), where p is the initial member, listed in A022008.
For n = 1 and n = 2 (see Example), the last member of the sextuplet has one digit more than the initial member (so the count would be 0 for these two, if all terms of the sextuplet had to have the same length). As far as we know, for all n > 2, all members of the sextuplets have the same length. A sufficient condition for this is that A033874(n) > 16.

Examples

			For n = 1, p = 7 is the only 1-digit prime to be the initial term of a prime sextuplet, (7, 11, 13, 17, 19, 23), hence a(1) = 1.
For n = 2, p = 97 is the only 2-digit prime to be the initial term of a prime sextuplet, (97, 101, 103, 107, 109, 113), whence a(2) = 1.
For n = 3 and n = 4, there is no n-digit prime to be the initial term of a prime sextuplet, so a(n) = 0.
For n = 5, {16057, 19417, 43777} are the only 5-digit primes which are initial members of a prime sextuplet, therefore a(5) = 3.
		

Crossrefs

Cf. A022008 (initial members of prime sextuplets), A033874 (10^n - precprime(10^n)).

Programs

  • PARI
    apply( {A350826(n,L=10^n)=n=L\10; for(c=0,oo, L<(n=next_A022008(n)) && return(c))}, [1..8])

Formula

a(n) = # { p in A022008 | 10^(n-1) < p < 10^n }.

Extensions

a(10)-a(12) from David A. Corneth, Jan 17 2022
a(13)-a(17) from Hugo Pfoertner, Jan 21 2022

A104094 Largest prime <= 9^n.

Original entry on oeis.org

7, 79, 727, 6553, 59029, 531383, 4782961, 43046623, 387420479, 3486784393, 31381059607, 282429536453, 2541865828309, 22876792454939, 205891132094623, 1853020188851807, 16677181699666513, 150094635296999111
Offset: 1

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Cf. A013604.
Largest prime <= b^n: 2^n-A013603(n), 3^n-A013604(n), 4^n-A013606(n), 5^n-A013605(n), 6^n-A013607(n), 7^n-A013608(n), 8^n-A013603(3*n), 10^n-A033874(n).

Programs

  • Maple
    f:= n -> prevprime(9^n):
    map(f, [$1..30]); # Robert Israel, Aug 12 2019
  • Mathematica
    NextPrime[#,-1]&/@(9^Range[20]) (* Harvey P. Dale, Apr 21 2024 *)
  • PARI
    g(n,b) = for(x=0,n,print1(precprime(b^x)","))

Formula

a(n) = 9^n - A013604(2*n) = A001019(n) - A013604(2*n), n > 0. A.H.M. Smeets, Aug 12 2019

A157036 Shorthand for A157035, the largest prime with 2^n digits.

Original entry on oeis.org

3, 3, 27, 11, 63, 21, 51, 17, 813, 377, 7017, 27381, 7763, 1133, 119387, 67347, 121877
Offset: 0

Views

Author

Lekraj Beedassy, Feb 22 2009

Keywords

Comments

The actual prime A157035(n) is obtained as 10^(2^n) - a(n).

Crossrefs

Programs

  • Maple
    a:= n-> (t-> t-prevprime(t))(10^(2^n)):
    seq(a(n), n=0..10);  # Alois P. Heinz, Mar 02 2022
  • PARI
    { a(n) = 10^(2^n) - precprime(10^(2^n)) } \\ Max Alekseyev, Mar 28 2009
    
  • Python
    from sympy import prevprime
    def a(n): return 10**(2**n) - prevprime(10**(2**n))
    print([a(n) for n in range(10)]) # Michael S. Branicky, Mar 02 2022

Formula

a(n) = 10^(2^n) - A157035(n).
a(n) = A033874(2^n).

Extensions

a(8)-a(13) from Ray Chandler and Max Alekseyev, Mar 22 2009
a(14) from Jinyuan Wang, Feb 22 2022
a(15) from Michael S. Branicky, Jun 19 2024
a(16) from Michael S. Branicky, Jun 27 2024

A038805 Difference between last prime < 10^n and 10^n is a record high.

Original entry on oeis.org

1, 4, 9, 21, 24, 34, 56, 66, 92, 100, 112, 117, 135, 180, 260, 349, 387, 393, 411, 574, 617, 787, 1209
Offset: 1

Views

Author

Keywords

Examples

			For a(19)=411, the difference is 4433 and no other n <= 540 exceeds that difference.
		

Crossrefs

Cf. A033874.

Programs

  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; d = 0; k = 1; Do[ While[f = 10^k - PrevPrim[10^k]; d >= f, k++ ]; d = f; Print[k], {n, 1, 50}]

Extensions

Edited and extended by Robert G. Wilson v, Jun 18 2002
a(23) from Robert G. Wilson v, Jan 10 2007

A097517 Consider the difference (A033873(k)) between the smallest prime > 10^k and 10^k; sequence lists the successive values of A033873(k) which are primes.

Original entry on oeis.org

7, 3, 3, 19, 7, 7, 19, 3, 37, 31, 37, 61, 3, 3, 7, 13, 67, 103, 331, 61, 193, 67, 43, 3, 109, 31, 193, 151, 31, 3, 19, 7, 79, 13, 103, 151, 373, 181, 31, 79, 97, 151, 127, 3, 3, 79, 3, 19, 457, 7, 139, 271, 79, 709, 79, 3, 283, 7, 283, 13, 13, 73, 67, 13, 151, 37, 193, 337
Offset: 1

Views

Author

Cino Hilliard, Aug 27 2004

Keywords

Crossrefs

This is the prime subsequence of A033873. Cf. A033874.

Programs

  • Mathematica
    f[n_]:=Module[{x=10^n},NextPrime[x]-x];Select[f/@Range[0,200],PrimeQ] (* Harvey P. Dale, May 03 2021 *)

Extensions

Definition corrected by N. J. A. Sloane, May 03 2021. Thanks to Harvey P. Dale for pointing out that something was wrong.

A118798 Numbers n such that the closest primes surrounding 10^n have the same last two digits.

Original entry on oeis.org

79, 178, 179, 186, 210, 284, 300, 349, 391, 456, 594, 595, 599, 624, 645, 654, 659, 704, 712, 713, 860, 871, 892, 904, 924, 990, 1015, 1089, 1097, 1110, 1118, 1151, 1165, 1374, 1396, 1459, 1709, 1721, 1826, 1831, 1911, 1943, 1956, 2005, 2061, 2082, 2089
Offset: 1

Views

Author

Cino Hilliard, May 23 2006

Keywords

Comments

79 {251, 49}, 178 {239, 261}, 179 {221, 979}, 186 {479, 721}, 210 {171, 1129}, 284 {467, 133}, 300 {69, 331}, 349 {2603, 297}, 391 {123, 477}, 456 {633, 567}, 594 {11, 789}, 595 {503, 297}, 599 {2339, 2161}, 624 {413, 187}, 645 {3291, 109}, 654 {1811, 1089}, 659 {2363, 937}, 704 {3489, 211},
712 {171, 1029}, 713 {801, 2299}, 860 {1193, 2907}, 871 {827, 1473}, 892 {629, 271}, 904 {503, 597}, 924 {303, 4797}, 990 {3, 1197}, 1015 {71, 1029}, 1089 {4403, 5997}, 1097 {2271, 1429}, 1110 {2373, 2527}, 1118 {1767, 2233}, 1151 {2703, 97}, 1165 {33, 3867}, 1374 {689, 1411},
1396 {1023, 3477}, 1459 {10211, 489}, 1709 {2859, 4241}, 1721 {10311, 189}, 1826 {1761, 1539}, 1831 {17751, 1449}, 1911 {4179, 2621}, 1943 {1279, 1721}, 1956 {541, 9459}, 2005 {141, 14259}, 2061 {6607, 3293}, 2082 {9537, 4563}, 2089 {597, 203}, 2091 {2517, 9783}, 2135 {7287, 3513}, ...,.

Examples

			79 is in the sequence since the two primes nearest primes 10^79 are 10^79 - 251 and 10^79 + 49.
		

Crossrefs

Cf. A115564.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ@k, k-- ]; k]; fQ[n_] := Mod[NextPrim[10^n], 100] == Mod[PrevPrim[10^n], 100]; Do[ If[ fQ@n, Print@n], {n, 2, 1250}] (* Robert G. Wilson v, May 27 2006 *)
    Select[Range[2100],Mod[NextPrime[10^#],100]==Mod[NextPrime[10^#,-1],100]&] (* Harvey P. Dale, Mar 09 2019 *)
  • PARI
    g(n) = for(j=1,n,x=precprime(10^j);y=nextprime(10^j);if(x%100==y%100,print1 (j",")))

Formula

A033873 + A033874 == 0 (mod 100). - Robert G. Wilson v, May 27 2006

Extensions

More terms from Robert G. Wilson v, May 27 2006 - Jun 14 2006
Showing 1-10 of 14 results. Next