OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local p, k;
p:= ithprime(n);
for k from 1 do if ithprime(n+k) - k mod p = 0 then return k fi
od:
end proc:
map(f, [$1..100]); # Robert Israel, Oct 27 2017
MATHEMATICA
bb={}; Do[Do[If[k==Mod[Prime[n+k], Prime[n]], bb=Append[bb, k]; Goto[ne]]; Label[ne], {k, Prime[n]-1}], {n, 100}]; bb
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 30 2005
EXTENSIONS
Corrected by Robert Israel, Oct 27 2017
STATUS
approved