OFFSET
1,1
COMMENTS
If k=2^j then n+j is a Mersenne exponent.
a(n)=3 if and only if 3*2^n-1 is a prime; that is, n belongs to A002235. - Altug Alkan, Oct 08 2015
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
EXAMPLE
3*2^1-1=5 prime so a(1)=3;
3*2^2-1=11 prime so a(2)=3;
3*2^3-1=23 prime so a(3)=3.
MATHEMATICA
a[n_] := For[k = 3, True, k++, If[PrimeQ[k*2^n - 1], Return[k]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 07 2015 *)
PROG
(PARI) a(n) = {k=3; while (! isprime(k*2^n-1), k++); k; } \\ Michel Marcus, Oct 08 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Oct 07 2015
STATUS
approved