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.

A132860 Smallest number at distance 2n from nearest prime (variant 2).

Original entry on oeis.org

2, 0, 93, 119, 531, 897, 1339, 1341, 1343, 9569, 15703, 15705, 19633, 19635, 31425, 31427, 31429, 31431, 31433, 155959, 155961, 155963, 360697, 360699, 360701, 370311, 370313, 370315, 370317, 1349591, 1357261, 1357263, 1357265, 1357267
Offset: 1

Views

Author

R. J. Mathar, Nov 18 2007, Nov 30 2007

Keywords

Comments

Let f(m) be the distance to the nearest prime as defined in A051699(m). Then a(n) = min { m: f(m)= 2n }. A051728 uses A051700(m) to define the distance.
Note that the requirement f(m)>=2n yields the same sequence as f(m)=2n here. (Reasoning: We are essentially probing for prime gaps of size 4n or larger while increasing m. One cannot get earlier hits by relaxing the requirement from the equal to the larger-or-equal sign, because m triggers as soon as the distance to the start of the gap reaches 2n, with both definitions. This is an inherent consequence of using A051699.)

Crossrefs

Programs

  • Maple
    A051699 := proc(m) if isprime(m) then 0 ; elif m <= 2 then op(m+1,[2,1]) ; else min(nextprime(m)-m,m-prevprime(m)) ; fi ; end: a := proc(n) local m ; for m from 0 do if A051699(m) = 2 * n then RETURN(m) ; fi ; od: end: seq(a(n),n=0..18);

Formula

a(n) = min {m : A051699(m) = 2n}.