login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers n such that f(n) = f(n-1) - f(n-2) where f is the prime gap function given by f(m) = prime(m+1) - prime(m) and prime(m) denotes the m-th prime.
1

%I #17 Oct 23 2023 22:27:30

%S 5,7,10,12,19,22,28,33,45,52,59,63,81,85,92,95,115,136,138,140,144,

%T 147,171,192,198,209,211,222,224,236,249,253,256,268,270,279,288,315,

%U 318,322,325,348,355,358,373,400

%N Numbers n such that f(n) = f(n-1) - f(n-2) where f is the prime gap function given by f(m) = prime(m+1) - prime(m) and prime(m) denotes the m-th prime.

%H Harry J. Smith, <a href="/A066513/b066513.txt">Table of n, a(n) for n = 1..1000</a>

%t f[x_] := Prime[x + 1] - Prime[x]; Select[Range[3, 10^3], f[ # ] == f[ # - 1] - f[ # - 2] &]

%t Flatten[Position[Partition[Differences[Prime[Range[500]]],3,1],_?(#[[3]] == #[[2]]-#[[1]]&),1,Heads->False]]+2 (* _Harvey P. Dale_, Mar 19 2019 *)

%o (PARI) Gap(m) = { return(prime(m+1) - prime(m)); }

%o { n=0; for (m=3, 10^10, if (Gap(m) == Gap(m-1) - Gap(m-2), write("b066513.txt", n++, " ", m); if (n==1000, return)) ) } \\ _Harry J. Smith_, Feb 20 2010

%Y Cf. A001223 (f).

%K nonn

%O 1,1

%A _Joseph L. Pe_, Jan 04 2002