OFFSET
1,1
COMMENTS
Exactly one integer exists between each p(n+3) and p(n) which is divisible by (p(n+3)-p(n)).
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n)=p(n+3) - (p(n) (mod p(n+3)-p(n))).
EXAMPLE
Between the primes 19 and 31 is the composite 24 and 24 is divisible by (31-19)=12. So 24 is in the sequence.
MATHEMATICA
f[n_] := Block[{p = Prime[n], q = Prime[n + 3]}, q - Mod[p, q - p]]; Table[ f[n], {n, 58}] (* Robert G. Wilson v *)
id[{a_, b_, c_, d_}]:=Select[Range[a+1, d-1], Divisible[#, d-a]&]; Flatten[ id/@ Partition[Prime[Range[70]], 4, 1]] (* Harvey P. Dale, May 07 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 08 2005
EXTENSIONS
More terms from Robert G. Wilson v, Nov 09 2005
STATUS
approved