OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=3 because 3=1*2^2-1 and it is the first prime of this form.
MAPLE
N:= 10^6: # to get all terms <= N
sort(convert(select(isprime, {seq(seq(k*2^m-1, k=1..min((N+1)/2^m, 2^m-1), 2), m=1..ilog2(N+1))}), list)); # Robert Israel, May 23 2017
MATHEMATICA
Take[Sort@ Select[Flatten@ Table[k 2^m - 1, {m, 0, 15}, {k, 1, 2^m - 1, 2}], PrimeQ], 45] (* Michael De Vlieger, May 23 2017, after Robert G. Wilson v at A112714 *)
PROG
(PARI) for(n=2, 8, for(k=2^(n-2)+1, 2^n, M=k*2^n-1; if(isprime(M), print1(M", "), 0)))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jose Brox (tautocrona(AT)terra.es), Dec 31 2005
STATUS
approved