OFFSET
2,1
COMMENTS
Exactly one composite exists between each p(n+1) and p(n) which is divisible by (p(n+1)-p(n)), for n >= 2.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
FORMULA
a(n)=p(n+1) - (p(n) (mod p(n+1)-p(n))).
EXAMPLE
Between the primes 67 and 71 is the composite 68 and 68 is divisible by (71-67)=4. So 68 is in the sequence.
MATHEMATICA
f[n_] := Block[{p = Prime[n], q = Prime[n + 1]}, q - Mod[p, q - p]]; Table[ f[n], {n, 2, 60}] (* Robert G. Wilson v *)
cbp[{a_, b_}]:=Select[Range[a+1, b-1], Divisible[#, b-a]&]; cbp/@ Partition[ Prime[ Range[2, 100]], 2, 1]//Flatten (* Harvey P. Dale, Jan 09 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 06 2005
EXTENSIONS
More terms from Don Reble and Robert G. Wilson v, Nov 07 2005
STATUS
approved