OFFSET
1,3
EXAMPLE
a(5) = 6 because 5 divides 20, which is prime(5+6) - prime(5)), and if 0 < k < 6, then 5 does not divide prime(5+k) - prime(5).
MAPLE
f:= proc(n) local p, k, q;
p:= ithprime(n); q:= p;
for k from 1 do
q:= nextprime(q);
if (q - p) mod n = 0 then return k fi;
od
end proc:
map(f, [$1..100]); # Robert Israel, Jan 26 2023
MATHEMATICA
p[n_] := Prime[n];
a[n_] := Select[Range[1000], IntegerQ[(p[n + #] - p[n])/n] &, 1]
Flatten[Table[a[n], {n, 1, 130}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 26 2023
STATUS
approved