OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1014
EXAMPLE
MATHEMATICA
nn = 20; t = Table[-n + 1, {n, nn}]; p = 1; While[Min[t] <= 0, p = NextPrime[p]; b = Total[IntegerDigits[p, 2]]; If[b <= nn, If[t[[b]] < 0, t[[b]]++, If[t[[b]] == 0, t[[b]] = p]]]]; t (* T. D. Noe, Jan 27 2014 *)
PROG
(PARI) lista(nn) = {prm = primes(5000000); for (n = 1, nn, ltp = select(p->hammingweight(p)== n, prm); print1(ltp[n], ", "); ); } \\ Michel Marcus, Jan 27 2014
(Python)
from itertools import combinations
from sympy import isprime
def A236513(n):
l, k, c = n-1, 2**n, 0
while True:
for d in combinations(range(l-1, -1, -1), l-n+1):
m = k-1 - sum(2**(e) for e in d)
if isprime(m):
c += 1
if c == n:
return m
l += 1
k *= 2 # Chai Wah Wu, Sep 02 2021
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Irina Gerasimova, Jan 27 2014
EXTENSIONS
a(24)-a(32) from Giovanni Resta, Feb 04 2014
STATUS
approved