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

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.

A003617 Smallest n-digit prime.

Original entry on oeis.org

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

Views

Author

Keywords

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

Programs

  • Maple
    a:= n-> nextprime(10^(n-1)):
    seq(a(n), n=1..20);  # Alois P. Heinz, Feb 11 2021
  • Mathematica
    Table[a := 10^n + 1; While[ ! PrimeQ[a], a++ ]; a, {n, 0, 30}] (* Stefan Steinerberger, Apr 08 2006 *)
    NextPrime/@(10^Range[0,20])  (* Harvey P. Dale, May 01 2011 *)
  • PARI
    a(n)=nextprime(10^(n-1)) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from sympy import nextprime
    print([nextprime(10**(n-1)) for n in range(1, 21)]) # Michael S. Branicky, Feb 11 2021

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

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

A124001 Difference between first twin prime > 10^n and 10^n.

Original entry on oeis.org

2, 1, 1, 19, 7, 151, 37, 139, 37, 7, 277, 817, 61, 1267, 97, 2371, 1549, 19, 619, 97, 391, 409, 649, 5527, 2731, 559, 949, 427, 601, 2797, 1681, 7189, 2449, 6751, 7597, 8419, 16879, 871, 5569, 10327, 16111, 2131, 6121, 23329, 5179, 4249, 2641, 2257, 3997
Offset: 0

Views

Author

Zak Seidov, Nov 01 2006

Keywords

Comments

a(n) >= A033873(n) and a(n) = A033873(n) for n = 1, 2, 4, 9.
As N increases, the ratio (Sum_{n=1..N} a(n)/n^2)/N tends to 4. - Pierre CAMI, Jul 12 2013

Examples

			a(0) = 2 because 3 and 5 are twin primes and 3 - 10^0 = 2,
a(1) = 1 because 11 and 13 are twin primes and 11 - 10^1 = 1,
a(2) = 1 because 101 and 103 are twin primes and 101 - 10^2 = 1,
a(3) = 19 because 1019 and 1021 are twin primes and 1019 - 10^3 = 19, etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = q = NextPrime[10^n]}, While[p + 2 != q, p = q; q = NextPrime@ q]; p - 10^n]; Array[f, 49, 0] (* Robert G. Wilson v, Nov 28 2015 *)
    ftp[n_]:=Module[{p=NextPrime[n]},While[CompositeQ[p+2],p=NextPrime[p]];p-n]; Table[ftp[10^n],{n,0,50}] (* Harvey P. Dale, Oct 15 2019 *)

Formula

a(n) = A092245(n+1) - 10^n. - Robert G. Wilson v, Nov 28 2015

A098147 Difference between first odd semiprime > 10^n and 10^n.

Original entry on oeis.org

5, 11, 3, 1, 1, 1, 1, 1, 13, 3, 7, 7, 15, 13, 3, 3, 15, 7, 1, 19, 3, 19, 13, 29, 7, 7, 3, 27, 13, 3, 1, 9, 9, 9, 27, 7, 3, 7, 49, 55, 81, 3, 3, 9, 7, 11, 69, 7, 19, 13, 39, 7, 1, 3, 13, 13, 39, 77, 27, 63, 31, 51, 19, 9, 27, 3, 1, 39, 19, 41, 21, 67, 37, 63, 69, 33, 3, 9, 37, 67, 121, 9, 21
Offset: 1

Views

Author

Hugo Pfoertner, Aug 28 2004

Keywords

Examples

			a(2)=11: The first odd semiprime following 10^2 is 111=3*37; 111-100=11.
		

Crossrefs

Cf. A098146, A033873 difference between first prime > 10^n and 10^n.

Formula

a(n)=A098146(n)-10^n.

A084475 a(n) defines the first brilliant number, b_n, greater than 10^n. If n is odd or zero, then b_n is 10^n+a(n); and if n is a positive even number, then b_n is {10^(n/2)+a(n)}^2.

Original entry on oeis.org

3, 0, 1, 3, 1, 13, 9, 43, 7, 81, 3, 147, 3, 73, 19, 3, 7, 831, 7, 49, 19, 987, 3, 691, 39, 183, 37, 4153, 31, 279, 37, 667, 61, 709, 3, 277, 3, 1687, 51, 997, 39, 1207, 117, 91, 9, 1411, 117, 393, 7, 951, 13, 9793, 67, 2217, 103, 6229, 331, 2317, 319, 213, 57, 399, 33, 19
Offset: 0

Views

Author

Jason Earls, Jun 03 2003

Keywords

Examples

			a(5)=13 because 10^5+13 = 100013 = 103*971 and a(6)=9 because (10^3+9)^2 = 1009^2. For n>0, a(2n) = A033873(n).
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; LengthBase10[n_] := Floor[ Log[10, n] + 1]; f[n_] := Block[{k = 0}, If[ EvenQ[n] && n > 1, NextPrim[ 10^(n/2)]^2 - 10^(n/2), While[fi = FactorInteger[10^n + k]; Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ fi] != 2 || Length[ Union[ LengthBase10 /@ Flatten[ Table[ # [[1]], {1}] & /@ fi]]] != 1, k++ ]; k]]; Table[ f[n], {n, 0, 63}]

Extensions

Edited and extended by Robert G. Wilson v, Jun 27 2003

A127796 a(n) = nextprime(9^n) - 9^n.

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 16, 2, 26, 10, 8, 4, 2, 2, 26, 4, 70, 34, 2, 8, 118, 4, 8, 68, 56, 28, 50, 28, 62, 158, 16, 122, 92, 28, 20, 110, 140, 70, 28, 44, 20, 124, 316, 38, 8, 44, 136, 58, 110, 2, 148, 170, 116, 170, 40, 2, 182, 10, 46, 254, 56, 14, 8, 2, 190, 148, 382, 10, 56, 10
Offset: 0

Views

Author

Artur Jasinski, Jan 29 2007

Keywords

Crossrefs

Programs

  • Mathematica
    << NumberTheory`NumberTheoryFunctions` a = {}; Do[k = NextPrime[9^x] - 9^x; AppendTo[a, k], {x, 0, 100}]; a

Formula

a(n) = A013632(A001019(n)). - Michel Marcus, Nov 18 2019

A084476 Least k such that 10^(2n-1)+k is a brilliant number.

Original entry on oeis.org

0, 3, 13, 43, 81, 147, 73, 3, 831, 49, 987, 691, 183, 4153, 279, 667, 709, 277, 1687, 997, 1207, 91, 1411, 393, 951, 9793, 2217, 6229, 2317, 213, 399, 19, 2317, 609, 2607, 11901, 10563, 5473, 3, 5923, 17527, 8569, 16701, 11989, 9757, 6489, 3489, 2899
Offset: 1

Views

Author

Robert G. Wilson v, Jun 27 2003

Keywords

Comments

Least brilliant number greater than 10^(2n) is {10^n+A033873(n)}^2. The web site also lists the two prime factors.

Examples

			a(3)=13 because 10^5+13 = 100013 = 103*971.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; LengthBase10[n_] := Floor[ Log[10, n] + 1]; f[n_] := Block[{k = 0}, If[ EvenQ[n] && n > 1, NextPrim[ 10^(n/2)]^2 - 10^(n/2), While[fi = FactorInteger[10^n + k]; Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ fi] != 2 || Length[ Union[ LengthBase10 /@ Flatten[ Table[ # [[1]], {1}] & /@ fi]]] != 1, k++ ]; k]]; Table[ f[2n + 1], {n, 1, 24}]
Showing 1-10 of 27 results. Next