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

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

A340219 Constant whose decimal expansion is the concatenation of the smallest n-digit prime A003617(n), for n = 1, 2, 3, ...

Original entry on oeis.org

2, 1, 1, 1, 0, 1, 1, 0, 0, 9, 1, 0, 0, 0, 7, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 1, 9, 1, 0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 1, 0, 0, 0
Offset: 0

Views

Author

M. F. Hasler, Jan 01 2021

Keywords

Comments

The terms of sequence A215641 converge to this sequence of digits, and to this constant, up to powers of 10.

Examples

			The smallest prime with 1, 2, 3, 4, ... digits is, respectively, 2, 11, 101, 1009, .... Here we list the sequence of digits of these numbers: 2: 1, 1; 1, 0, 1; 1, 0, 0, 9; ...
This can be considered, as for the Champernowne and Copeland-Erdős constants, as the decimal expansion of a real constant 0.2111011009...
		

Crossrefs

Cf. A003617 (smallest n-digit prime), A215641 (has this as "limit"), A340206 (same for squares, limit of A215689), A340207 (similar, with largest n-digit squares, limit of A339978), A340208 (same for cubes, limit of A215692), A340209 (same with largest n-digit cube, limit of A340115), A340221 (same for semiprimes, limit of A215647).
Cf. A033307 (Champernowne constant), A030190 (binary), A001191 (concatenation of all squares), A134724 (cubes), A033308 (primes: Copeland-Erdős constant).

Programs

  • Mathematica
    Flatten[Table[IntegerDigits[NextPrime[10^n]],{n,0,20}]] (* Harvey P. Dale, Mar 29 2024 *)
  • PARI
    concat([digits(nextprime(10^k))|k<-[0..14]]) \\ as seq. of digits
    c(N=20)=sum(k=1,N,.1^(k*(k+1)/2)*nextprime(10^(k-1))) \\ as constant

Formula

c = 0.21110110091000710000310000031000001910000000710000000071000000001...
= Sum_{k >= 1} 10^(-k(k+1)/2)*nextprime(10^(k-1))
a(-n(n+1)/2) = 1 for all n >= 2, followed by increasingly more zeros.

A272006 a(n) = A003617(n) - A062397(n-1).

Original entry on oeis.org

0, 0, 0, 8, 6, 2, 2, 18, 6, 6, 18, 2, 38, 36, 30, 36, 60, 2, 2, 50, 38, 116, 8, 116, 6, 12, 66, 102, 330, 318, 56, 32, 48, 60, 192, 68, 66, 42, 132, 2, 120, 108, 62, 56, 30, 8, 120, 32, 192, 8, 150, 120, 326, 170, 30, 20, 2, 278, 158, 18, 6, 92, 446, 120, 56, 48, 48, 48, 98, 8, 32, 272, 38, 78, 206
Offset: 1

Views

Author

Carauleanu Marc, Jul 13 2016

Keywords

Examples

			For n=4, the smallest 4-digit prime is 1009, and 10^(4-1) + 1 = 1001, so a(4) = 1009 - 1001 = 8. - _Michael B. Porter_, Aug 01 2016
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[#] - (# + 1) &[10^(n - 1)], {n, 75}] (* Michael De Vlieger, Jul 13 2016 *)
  • PARI
    a(n) = nextprime(10^(n-1)) - (10^(n-1) +  1); \\ Michel Marcus, Jul 28 2016

Formula

a(n) = A033873(n-1) - 1. - Michel Marcus, Jul 28 2016

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

A033874 Difference between the largest prime < 10^n (A003618) and 10^n.

Original entry on oeis.org

3, 3, 3, 27, 9, 17, 9, 11, 63, 33, 23, 11, 29, 27, 11, 63, 3, 11, 39, 11, 101, 27, 23, 257, 123, 141, 99, 209, 27, 11, 27, 21, 9, 411, 23, 159, 81, 59, 57, 17, 119, 83, 81, 53, 9, 33, 41, 33, 57, 57, 323, 231, 177, 291, 111, 593, 93, 149, 141, 161, 39, 83, 123, 51, 269
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net)

Keywords

Examples

			a(4) = 27 because 10^4 - 9973 = 27. The 21st term is 101 since 10^21 - 101 = 999999999999999999899 is prime.
		

References

  • Knuth, Art of Computer Programming, volume 2, pages 13 and 390.
  • Journal of Recreational Mathematics, volume 14, number 4, page 285.
  • Journal of Recreational Mathematics, volume 20 ,number 3, page 209-210.
  • O'Hara, J. Rec. Math., 22 (1990), Table on page 278.

Crossrefs

Programs

  • Magma
    [10^n-PreviousPrime(10^n): n in [1..65]]; // Vincenzo Librandi, Sep 13 2016
  • Maple
    seq(10^n-prevprime(10^n),n=1..65); # Emeric Deutsch, Apr 20 2006
  • Mathematica
    PrevPrime[ n_Integer ] := Module[ {k}, k = n - 1; While[ ! PrimeQ[ k ], k-- ]; k ]; Table[ 10^n - PrevPrime[ 10^n ], {n, 1, 75} ] (* Robert G. Wilson v, Sep 09 2000 *)
    Table[10^i - NextPrime[10^i, -1], {i, 0, 70}] (* Harvey P. Dale, Jan 13 2011 *)
  • PARI
    a(n)=10^n-precprime(10^n) \\ Charles R Greathouse IV, Aug 03 2014
    

Extensions

More terms from Patrick De Geest

A099656 a(n) is the least prime following A002276(n) repdigits.

Original entry on oeis.org

2, 3, 23, 223, 2237, 22229, 222247, 2222239, 22222223, 222222227, 2222222243, 22222222223, 222222222301, 2222222222243, 22222222222229, 222222222222227, 2222222222222281, 22222222222222301, 222222222222222281
Offset: 0

Views

Author

Labos Elemer, Nov 17 2004

Keywords

Examples

			n=2: 22 is followed by 23.
		

Crossrefs

Programs

  • Maple
    seq(nextprime(2*(10^i-1)/9), i=0..20); # Robert Israel, Aug 25 2017
  • Mathematica
    Table[NextPrime[2*(10^n-1)/9], {n, 0, 35}]
    Table[ NextPrime[2*(10^n - 1)/9], {n, 0, 18}] (* Robert G. Wilson v, Nov 20 2004 *)
    Table[NextPrime[FromDigits[PadRight[{},n,2]]],{n,0,20}] (* Harvey P. Dale, Dec 15 2021 *)

A215641 Smallest prime whose decimal expansion consists of the concatenation of a 1-digit prime, a 2-digit prime, a 3-digit prime, ..., and an n-digit prime.

Original entry on oeis.org

2, 211, 211151, 2111011129, 211101100910009, 211101100910007100049, 2111011009100071000031000453, 211101100910007100003100000310000721, 211101100910007100003100000310000019100000543, 2111011009100071000031000003100000191000000071000000531
Offset: 1

Views

Author

Jonathan Vos Post, Aug 18 2012

Keywords

Comments

It is a plausible conjecture that a(n) always exists.
a(n) has A000217(n) = n*(n+1)/2 digits.

Examples

			a(4) = 2111011129, the smallest prime formed from a single-digit, a double-digit, a triple-digit, and a quadruple-digit prime, i.e., 2, 11, 101, 1129.
		

Crossrefs

Subsequence of A195302.
Cf. A338968 (similar, with largest prime).

Extensions

Edited by N. J. A. Sloane, Aug 18 2012

A069588 Smallest prime in which the n-th significant digit is a 1.

Original entry on oeis.org

11, 11, 101, 1009, 10007, 100003, 1000003, 10000019, 100000007, 1000000007, 10000000019, 100000000003, 1000000000039, 10000000000037, 100000000000031, 1000000000000037, 10000000000000061, 100000000000000003, 1000000000000000003, 10000000000000000051
Offset: 1

Views

Author

Amarnath Murthy, Mar 25 2002

Keywords

Comments

Essentially (i.e., except for the initial term), the same as A003617. The definition is misleading, since "n-th significant digit" seems to mean here "most significant digit" (except for a(1)), while the "significance" is decreasing when going from the first to the last digit. (E.g., 1234 rounded to 2 significant digits is 1200, so "1,2" should be the first and second (and not fourth and third) significant digits.) [M. F. Hasler, Jun 03 2009]

Programs

  • Maple
    11,seq(nextprime(10^j),j=1..30);
  • Mathematica
    Join[{11}, NextPrime[10^Range[20]]] (* Paolo Xausa, Jun 23 2024 *)
  • Python
    from sympy import nextprime
    def a(n): return 11 if n == 1 else nextprime(10**(n-1))
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Nov 11 2021

Extensions

More terms from Sascha Kurz, Mar 28 2002
a(19) and beyond from Michael S. Branicky, Nov 11 2021

A099668 a(n) is the largest prime before A002282(n) repdigits.

Original entry on oeis.org

7, 83, 887, 8887, 88883, 888887, 8888861, 88888883, 888888887, 8888888837, 88888888859, 888888888887, 8888888888857, 88888888888873, 888888888888883, 8888888888888753, 88888888888888801, 888888888888888859, 8888888888888888881, 88888888888888888879, 888888888888888888857
Offset: 1

Views

Author

Labos Elemer, Nov 17 2004

Keywords

Examples

			n=2: 83 is before 88.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[8*(10^n-1)/9, -1], {n, 1, 35}]
    Table[NextPrime[FromDigits[PadRight[{},n,8]],-1],{n,20}] (* Harvey P. Dale, Jul 12 2014 *)

Formula

a(n) = A007917(A002282(n)). - Amiram Eldar, Jun 29 2025

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
Showing 1-10 of 58 results. Next