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).

This page as a plain text file.
%I A132860 #7 Jul 24 2024 02:06:16
%S A132860 2,0,93,119,531,897,1339,1341,1343,9569,15703,15705,19633,19635,31425,
%T A132860 31427,31429,31431,31433,155959,155961,155963,360697,360699,360701,
%U A132860 370311,370313,370315,370317,1349591,1357261,1357263,1357265,1357267
%N A132860 Smallest number at distance 2n from nearest prime (variant 2).
%C A132860 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.
%C A132860 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.)
%F A132860 a(n) = min {m : A051699(m) = 2n}.
%p A132860 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);
%Y A132860 Cf. A051728, A051699.
%K A132860 nonn
%O A132860 1,1
%A A132860 _R. J. Mathar_, Nov 18 2007, Nov 30 2007