OFFSET
1,1
COMMENTS
a(n) is the least k > 1 such that k*n is in A024675.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 3 because 3*4 = 12 is the average of consecutive primes 11 and 13.
MAPLE
M:= {seq((ithprime(i)+ithprime(i+1))/2, i=2..10^5)}:
f:= proc(p) local k;
for k from 2 do if member(k*p, M) then return k fi od
end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_] := Module[{m = 2*n}, While[Plus @@ NextPrime[m, {-1, 1}] != 2*m, m += n]; m/n]; Array[a, 100] (* Amiram Eldar, Aug 05 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 28 2022
STATUS
approved