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

A331834 Records of A038804: (Smallest prime > 10^n) - (largest prime < 10^n).

Original entry on oeis.org

4, 12, 34, 70, 124, 218, 264, 540, 604, 670, 754, 1182, 1310, 1418, 2606, 2702, 3516, 4248, 7358, 7680, 7692, 9060, 9962, 17568, 18052, 23784, 28218, 29814, 31024, 34788, 41438, 48984, 59568, 68986, 75944, 82700, 83232, 91840, 113108, 132652, 153094, 167608
Offset: 1

Views

Author

Robert G. Wilson v, Jan 28 2020

Keywords

Examples

			Smallest 2-digit prime is 11, largest 1-digit prime is 7, so 11 - 7 = 4 is a term; since there is no 0-digit prime, 4 is a(1).
		

Crossrefs

Cf. A038804.

Programs

  • Mathematica
    Block[{s = ToExpression /@ Map[StringSplit, Drop[Import["https://oeis.org/A038804/b038804.txt", "Data"], 4]][[All, -1]]}, Union@ FoldList[Max, s]] (* Michael De Vlieger, Mar 14 2020, using b-file at A038804 *)
    DeleteDuplicates[Table[NextPrime[10^n]-NextPrime[10^n,-1],{n,500}],GreaterEqual] (* The program generates the first 21 terms of the sequence. *) (* Harvey P. Dale, Aug 18 2025 *)
  • PARI
    d=0;for(k=1,500,my(t=10^k,dd=nextprime(t)-precprime(t));if(dd>d,print1(dd,", ");d=dd)) \\ Hugo Pfoertner, Mar 01 2020

Extensions

a(37)-a(42) from Giovanni Resta, Mar 15 2020

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

A058249 (Smallest prime >= 2^n) - (largest prime <= 2^n).

Original entry on oeis.org

0, 2, 4, 4, 6, 6, 4, 6, 12, 10, 14, 6, 18, 30, 22, 16, 30, 8, 22, 10, 26, 18, 24, 46, 74, 20, 68, 60, 14, 38, 12, 20, 26, 66, 84, 36, 34, 52, 30, 102, 48, 26, 86, 24, 114, 36, 120, 80, 150, 82, 150, 68, 116, 192, 58, 86, 22, 96, 186, 126, 16, 192, 54, 72, 180, 14, 22, 56
Offset: 1

Views

Author

Labos Elemer, Dec 05 2000

Keywords

Comments

This sequence gives the gap between consecutive primes on either side of 2^n. The average gap between primes near 2^n should be about g=n*log(2). Cramer's conjecture would allow gaps to be as large as about g^2. - T. D. Noe, Jul 17 2007

Examples

			n = 1: a(1) = 2 - 2 = 0,
n = 9: a(9) = 521 - 509 = 12.
		

Crossrefs

Programs

  • Maple
    a := n -> if n > 1 then nextprime(2^n)-prevprime(2^n) else 0 fi; [seq( a(i), i=1..256)]; # Maple's next/prevprime functions use strict inequalities and therefore would not yield the correct difference for n=1. Alternatively, a(n) = nextprime(2^n-1)-prevprime(2^n+1);
  • Mathematica
    Prepend[NextPrime[#]-NextPrime[#,-1]&/@(2^Range[2,70]),0] (* Harvey P. Dale, Jan 25 2011 *)
    Join[{0}, Table[NextPrime[2^n] - NextPrime[2^n, -1], {n, 2, 70}]]
  • PARI
    a(n)=nextprime(2^n)-precprime(2^n) \\ Charles R Greathouse IV, Sep 20 2016

Formula

a(n) = A014210(n) - A014234(n) = A013603(n) + A013597(n).

Extensions

Edited by M. F. Hasler, Feb 14 2017

A338155 (Smallest prime >= 3^n) - (largest prime <= 3^n).

Original entry on oeis.org

0, 4, 6, 4, 10, 6, 24, 10, 6, 22, 36, 74, 30, 10, 18, 124, 44, 20, 70, 16, 60, 6, 52, 30, 34, 22, 42, 48, 144, 30, 20, 104, 122, 90, 50, 12, 52, 18, 140, 156, 72, 126, 126, 42, 68, 90, 98, 100, 66, 74, 50, 174, 30, 38, 126, 72, 30, 378, 102, 176, 108, 130
Offset: 1

Views

Author

A.H.M. Smeets, Oct 25 2020

Keywords

Comments

Size of prime gap containing the number 3^n, for n > 1.
From Gauss's prime counting function approximation, the expected gap size should be approximately n*log(3), however, the observed values seem to be closer to n*log(8.72) ~ n*log(3^2) = n*A016632.

Crossrefs

Cf. A058249 (for 2^n), A338419 (for 5^n), A338376 (for 6^n), A038804 (for 10^n).

Programs

  • Mathematica
    a[1] = 0; a[n_] := First @ Differences @ NextPrime[3^n, {-1, 1}]; Array[a, 60] (* Amiram Eldar, Oct 30 2020 *)
  • PARI
    a(n) = if (n==1, 0, nextprime(3^n) - precprime(3^n)); \\ Michel Marcus, Oct 25 2020

Formula

a(n) = A013598(n) + A013604(n) for n > 1.

A338376 (Smallest prime >= 6^n) - (largest prime <= 6^n).

Original entry on oeis.org

2, 6, 12, 6, 30, 14, 22, 18, 32, 12, 94, 54, 52, 18, 98, 66, 84, 18, 36, 18, 30, 138, 80, 96, 30, 142, 36, 80, 52, 26, 78, 64, 126, 138, 94, 136, 162, 276, 110, 162, 206, 94, 78, 324, 186, 128, 118, 56, 102, 390, 78, 90, 18, 62, 94, 108, 220, 100, 336, 618
Offset: 1

Views

Author

A.H.M. Smeets, Oct 26 2020

Keywords

Comments

Size of prime gap containing the number 6^n, for n > 1.
From Gauss's prime counting function approximation, the expected gap size should be approximately n*log(6), however, the observed values seem to be closer to n*log(36) = n*A016659.
The arithmetic mean of a(n)/n for the terms 1..1000 is 3.605 ~ 2*log(6).

Crossrefs

Cf. A058249 (2^n), A338155 (3^n), A338419 (5^n), A038804 (10^n).

Programs

  • Mathematica
    a[n_] := First @ Differences @ NextPrime[6^n, {-1, 1}]; Array[a, 60] (* Amiram Eldar, Oct 30 2020 *)
  • PARI
    a(n) = my(pw=6^n); nextprime(pw+1) - precprime(pw-1); \\ Michel Marcus, Oct 27 2020

Formula

a(n) = A013607(n) + A013600(n).

A338419 (Smallest prime >= 5^n) - (largest prime <= 5^n).

Original entry on oeis.org

0, 6, 14, 12, 16, 10, 16, 66, 42, 10, 26, 70, 58, 14, 46, 86, 18, 114, 72, 74, 78, 72, 74, 96, 78, 14, 50, 76, 78, 130, 110, 286, 164, 170, 424, 154, 70, 132, 336, 162, 160, 90, 400, 342, 144, 36, 208, 108, 284, 98, 138, 216, 20, 66, 132, 504, 320, 120, 354
Offset: 1

Views

Author

A.H.M. Smeets, Oct 25 2020

Keywords

Comments

Size of prime gap containing the number 5^n, for n > 1.
From Gauss's prime counting function approximation, the expected gap size should be approximately n*log(5), however, the observed values seem to be closer to n*log(25) = n*A016648.
The arithmetic mean of a(n)/n for the terms 2..500 is 3.220 ~ 2*log(5) = A016648.

Crossrefs

Cf. A058249 (2^n), A338155 (3^n), A338376 (6^n), A038804 (10^n).

Programs

  • Mathematica
    a[1] = 0; a[n_] := First @ Differences @ NextPrime[5^n, {-1, 1}]; Array[a, 60] (* Amiram Eldar, Oct 30 2020 *)
  • PARI
    a(n) = if (n==1, 0, my(pw=5^n); nextprime(pw+1) - precprime(pw-1)); \\ Michel Marcus, Oct 27 2020

Formula

a(n) = A013599(n) + A013605(n) for n > 1.

A109937 Number of consecutive composite numbers in successive consecutive number sets in A109936; (smallest (n+1)-digit prime) - (largest n-digit prime) - 1.

Original entry on oeis.org

3, 3, 11, 33, 11, 19, 27, 17, 69, 51, 25, 49, 65, 57, 47, 123, 5, 13, 89, 49, 217, 35, 139, 263, 135, 207, 201, 539, 345, 67, 59, 69, 69, 603, 91, 225, 123, 191, 59, 137, 227, 145, 137, 83, 17, 153, 73, 225, 65, 207, 443, 557, 347, 321, 131, 595, 371, 307, 159, 167
Offset: 1

Views

Author

Amarnath Murthy, Jul 19 2005

Keywords

Crossrefs

Cf. A109936.

Programs

Formula

a(n) = A038804(n)-1. - R. J. Mathar, Feb 08 2008

Extensions

More terms from R. J. Mathar, Feb 08 2008

A330468 Numbers k where the difference (least prime > 10^k) - (greatest prime < 10^k) sets a record.

Original entry on oeis.org

1, 3, 4, 9, 16, 21, 24, 28, 34, 66, 82, 92, 117, 122, 135, 218, 232, 314, 387, 443, 478, 617, 652, 787, 1031, 1157, 1440, 1625, 1872, 1920, 2038, 2424, 2692, 3235, 3331, 3798, 4944, 5202, 5241, 5938, 7572, 7847
Offset: 1

Views

Author

Hugo Pfoertner, Mar 01 2020

Keywords

Examples

			a(1) = 1: 11 - 7 = 4;
a(2) = 3: 1009 - 997 = 12, whereas 101 - 97 = 4 <= a(1).
		

Crossrefs

Programs

  • PARI
    d=0;for(k=1,500,my(t=10^k,dd=nextprime(t)-precprime(t));if(dd>d,print1(k,", ");d=dd))

Extensions

More terms from Jinyuan Wang, Mar 01 2020
a(37)-a(42) from Giovanni Resta, Mar 15 2020
Showing 1-8 of 8 results.