OFFSET
1,2
EXAMPLE
M(2) = 2^3-1 = 7, 7^2+7-1 = 55 is composite, (2*7)^2+2*7-1 = 209 is composite,
(3*7)^2+3*7-1 = 461 is prime, 461 and 463 are twin primes, so a(2) = 3.
MATHEMATICA
f[p_] := Module[{k = 1}, While[!PrimeQ[(k*p)^2 + k*p - 1] || !PrimeQ[(k*p)^2 + k*p + 1], k++]; k]; f /@ (2^MersennePrimeExponent[Range[10]] - 1) (* Amiram Eldar, Jul 23 2021 *)
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Pierre CAMI, Jul 24 2006
EXTENSIONS
a(8) corrected and a(18)-a(19) added by Amiram Eldar, Jul 23 2021
STATUS
approved