2,1

Table of n, a(n) for n=2..56.

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.

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 *)

Sequence in context: A153801 A062867 A264027 * A215055 A152877 A071353

Adjacent sequences: A113536 A113537 A113538 * A113540 A113541 A113542

nonn

Zak Seidov, Jan 13 2006

Corrected and extended by Robert G. Wilson v, Jan 18 2006

approved