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

A380139 Prime gaps between 10^m and 10^(m+1), m>=0, sorted first by falling number of occurrences and then by rising gap size, written as an irregular triangle.

Original entry on oeis.org

2, 1, 4, 4, 6, 2, 8, 6, 4, 2, 10, 8, 12, 14, 18, 20, 6, 2, 4, 10, 12, 8, 14, 18, 16, 22, 24, 20, 30, 28, 26, 34, 32, 36, 6, 2, 4, 12, 10, 8, 18, 14, 16, 20, 22, 24, 30, 28, 26, 36, 32, 34, 40, 38, 42, 52, 44, 50, 46, 54, 58, 48, 56, 60, 62, 64, 72
Offset: 1

Views

Author

Hugo Pfoertner based on an idea by Richard Stephen Donovan, Jan 23 2025

Keywords

Comments

A gap between two primes p1 and p2 is assumed to belong to the range [10^m .. 10^(m+1)[ if 10^m <= (p1+p2)/2 < 10^(m+1). Thus the gap between 7 and 11 is counted in the interval 1 .. 10. Gaps symmetric to 10^k occur for k = 17, 45, ... .

Examples

			The triangle begins, with corresponding counts in [...]:
  [2, 1, 1]
   2, 1, 4,
  [7, 7, 6, 1]
   4, 6, 2, 8,
  [37, 32, 27, 16, 14,  8,  7,  1,  1]
    6,  4,  2, 10,  8, 12, 14, 18, 20
  [255, 170, 162, 103, 98, 86, 47, 39, 33, 16, 15, 14, 11,  5,  3,  3,  1,  1]
    6,   2,   4,   10, 12,  8, 14, 18, 16, 22, 24, 20, 30, 28, 26, 34, 32, 36,
  [1641, 1018, 1013, 860, 797, 672, 474, 430, 306, 223, 207, 191, 135, 93, 85, ...]
     6,    2,    4,   12,  10,  8,   18,  14,  16,  20,  22,  24,  30, 28, 26, ...
  [11609, 7040, 6945, 6928, 6163, 4796, 4395, 3749, 2542, 2476, 2164, 1949, ...]
     6,    12,    2,    4,   10,    8,   18,   14,   16,   24,   20,   22,  ...
  6, 12, 2, 4, 10, 18, 8, 14, 24, 16, 30, 20, 22, 28, 26, 36, 42, 34, ...
  6, 12, 4, 2, 10, 18, 8, 14, 24, 30, 16, 20, 22, 28, 26, 36, 42, 34, ...
  6, 12, 10, 4, 2, 18, 8, 14, 24, 30, 16, 20, 22, 28, 36, 26, 42, 34, ...
  6, 12, 18, 10, 2, 4, 8, 24, 30, 14, 20, 16, 22, 36, 28, 26, 42, 34, ...
		

Crossrefs

Cf. A005597, A173557, A305444 for the asymptotic behavior of gap sizes.

A382529 The composite numbers ordered by decreasing reciprocal-distance from the primes (reciprocal distance defined in comments).

Original entry on oeis.org

4, 6, 9, 8, 10, 15, 12, 14, 21, 26, 16, 25, 18, 20, 27, 34, 22, 33, 24, 35, 39, 28, 50, 30, 32, 45, 56, 49, 36, 51, 38, 64, 55, 40, 57, 42, 44, 63, 76, 46, 120, 65, 119, 93, 48, 69, 86, 121, 118, 92, 75, 52, 54, 94, 77, 122, 117, 81, 58, 85, 60, 62, 87, 123, 91, 144
Offset: 1

Views

Author

James Propp, Mar 30 2025

Keywords

Comments

The reciprocal distance between m and p is defined as d(m,p) = abs(1/m - 1/p).
The distance between a composite number m and the set of primes is d(m) = Min_{p prime} d(m,p), which means considering p which is the next prime below m, and q the next prime above m.
Bertrand's postulate p > m/2 means d(m) < 1/m so that all m with d(m) > epsilon are m < 1/epsilon.
The plot (e.g., ListPlot in Mathematica) shows interesting large-scale structure.

Examples

			a(3) and a(4) are 9 and 8 respectively. 9 precedes 8 in the list of composites because min(1/7-1/9,1/9-1/11) is greater than min(1/7-1/8,1/8-1/11).
		

Crossrefs

Programs

  • Mathematica
    epsilon = .0005; (* terms < 1/epsilon *);
    table = {}; For[m = 2, m <= 1/epsilon, m++, If[! PrimeQ[m], i = m; While[! PrimeQ[i], --i]; j = m; While[! PrimeQ[j], ++j]; dist = Min[1/i - 1/m, 1/m - 1/j]; If[dist > epsilon, table = Append[table, {dist, m}]]]]; init = Reverse[Sort[table]]; Transpose[init][[2]]
  • PARI
    a382529(nterms) = {my(m=nterms+nterms/log(nterms)+3*nterms/log(nterms)^2, mc=floor(m*if(nterms<337963, 4, log(m)/2-1)), C=vectorsmall(mc), L=List(), nc=0); forcomposite(n=4, mc, C[nc++]=n; my(d=min(1/precprime(n)-1/n,1/n-1/nextprime(n))); listput(L,d)); my(P=vecsort(L,,5)); vecextract(Vec(C),P)[1..nterms]}; \\ Hugo Pfoertner, Apr 22 2025

Extensions

More terms from Hugo Pfoertner, Mar 30 2025
Showing 1-2 of 2 results.