OFFSET
1,1
EXAMPLE
2*((2^2-1)^2) - 1 = 17, 2*((2^2-1)^2) + 1 = 19; 17 and 19 are twin primes so a(1) = 2.
MATHEMATICA
f[p_] := Module[{k = 1}, While[!PrimeQ[k*p^2 - 1] || !PrimeQ[k*p^2 + 1], k++]; k]; f /@ (2^MersennePrimeExponent[Range[10]] - 1) (* Amiram Eldar, Aug 28 2021 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Pierre CAMI, Oct 08 2004
EXTENSIONS
a(7) corrected, a(12) inserted and a(15)-a(18) added by Amiram Eldar, Aug 28 2021
STATUS
approved