OFFSET
2,1
EXAMPLE
First term (at n=2) is a(2)=2 because 3^2 +/- 2 are primes; second term (at n=3) is a(3)=4 because 3^3 +/- 4 are primes.
MATHEMATICA
f[n_] := Block[{k = 2}, While[ !PrimeQ[3^n + k] || !PrimeQ[3^n - k], k += 2]; k]; Table[ f[n], {n, 2, 56}] (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jan 13 2006
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Jan 18 2006
STATUS
approved