OFFSET
1,1
EXAMPLE
2*(2^2-1)*(2^3-1) + 1 = 43 is prime, so a(1) = 2.
2*(2^3-1)*(2^5-1) + 1 = 435 is composite, 4*(2^3-1)*(2^5-1) + 1 = 867 is composite, 6*(2^3-1)*(2^5-1) + 1 = 1303 is prime, so a(2) = 6.
MATHEMATICA
f[n_] := Module[{k = 1}, While[! PrimeQ[k*n + 1], k++]; k]; f /@ Times @@@ Partition[2^MersennePrimeExponent[Range[15]] - 1, 2, 1] (* Amiram Eldar, Jul 24 2021 *)
Table[k=1; x=(2^MersennePrimeExponent[n]-1)*(2^MersennePrimeExponent[n+1]-1); Monitor[Parallelize[While[True, If[PrimeQ[k*x+1], Break[]]; k++]; k], k], {n, 1, 24}] (* J.W.L. (Jan) Eerland, Jan 01 2024 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Pierre CAMI, Oct 17 2004
EXTENSIONS
a(15)-a(23) from Amiram Eldar, Jul 24 2021
a(24)-a(25) from J.W.L. (Jan) Eerland, Jan 02 2024
a(26) from Daniel Suteu, Jan 03 2024
STATUS
approved