OFFSET
1,3
LINKS
Chris Caldwell, The Top 20 Proth Primes
Chris Caldwell, The Prime Glossary, Proth prime
EXAMPLE
a(5) = 4 since first 4 Proth primes are 3, 5, 13, 17 all < 2^5.
MATHEMATICA
lst2 = {}; r = 47; lst1 = Union[Flatten@Table[Select[1 + 2^k*Range[1, 2^Min[k, r - k], 2], # < 2^r && PrimeQ[#] &], {k, r}]]; Do[AppendTo[lst2, Length@Select[lst1, # < 2^n &]], {n, r}]; lst2
PROG
(PARI) a(n)=my(c=0); for(m=1, n-1, k=1; until(k>2^m, p=k*2^m+1; if(p>2^n, break); if(isprime(p), c++); k=k+2)); c; \\ Arkadiusz Wesolowski, Mar 14 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Arkadiusz Wesolowski, Jul 04 2012
STATUS
approved