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.
%I A382529 #50 Apr 24 2025 08:37:00 %S A382529 4,6,9,8,10,15,12,14,21,26,16,25,18,20,27,34,22,33,24,35,39,28,50,30, %T A382529 32,45,56,49,36,51,38,64,55,40,57,42,44,63,76,46,120,65,119,93,48,69, %U A382529 86,121,118,92,75,52,54,94,77,122,117,81,58,85,60,62,87,123,91,144 %N A382529 The composite numbers ordered by decreasing reciprocal-distance from the primes (reciprocal distance defined in comments). %C A382529 The reciprocal distance between m and p is defined as d(m,p) = abs(1/m - 1/p). %C A382529 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. %C A382529 Bertrand's postulate p > m/2 means d(m) < 1/m so that all m with d(m) > epsilon are m < 1/epsilon. %C A382529 The plot (e.g., ListPlot in Mathematica) shows interesting large-scale structure. %H A382529 James Propp, <a href="/A382529/b382529.txt">Table of n, a(n) for n = 1..1440</a> %H A382529 Hugo Pfoertner, <a href="/A382529/a382529.png">Plot of a(n) and 4*n for n<=250000</a>. %H A382529 James Propp, <a href="/A382529/a382529.pdf">Plot of a(n) for n = 1..1440</a> %e A382529 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). %t A382529 epsilon = .0005; (* terms < 1/epsilon *); %t A382529 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]] %o A382529 (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 %Y A382529 Cf. A000040, A002386, A002808, A005250, A354604. %K A382529 nonn %O A382529 1,1 %A A382529 _James Propp_, Mar 30 2025 %E A382529 More terms from _Hugo Pfoertner_, Mar 30 2025