OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
Prime(10) = 29; both 32 - 29 = 3 and 32 + 29 = 61 are prime, and 32 is the smallest integer for which this is the case, so a(10) = 32.
MAPLE
f:= proc(n) local p, k;
p:= ithprime(n);
for k from p+1 by 2 do
if isprime(k+p) and isprime(k-p) then return k fi
od
end proc:
f(1):= 5:
map(f, [$1..100]); # Robert Israel, Jul 26 2015
MATHEMATICA
f[n_] := Block[{k = Prime[n], p = Prime[n]}, While[ !PrimeQ[k - p] || !PrimeQ[k + p], k++ ]; k]; Table[ f[n], {n, 60}] (* Robert G. Wilson v, Aug 28 2004 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Aug 27 2004
EXTENSIONS
Corrected by Robert G. Wilson v, Aug 28 2004
STATUS
approved