|
|
A308575
|
|
a(n) is the least positive even number k such that among the first k prime numbers there are exactly k/2 prime numbers where the n-th least significant bit is one, or a(n) = -1 if no such k exists.
|
|
1
|
|
|
2, 2946, 4, 18, 830, 86, 342, 498, 36002, 2310, 14660, 3791908, 138060, 160110, 998836, 4345842, 357341648, 56717562, 36609556, 5972021576, 2654687244, 8237027666, 22719286202, 1542163060562, 222365303318
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Is a(n) always positive?
|
|
LINKS
|
|
|
FORMULA
|
When a(n) > 0, Sum_{k = 1..a(n)} (-1)^floor(prime(k)/2^(n-1)) = 0 (where prime(k) denotes the k-th prime number).
|
|
PROG
|
(PARI) { s = vector(18); a = vector(#s); u = 1; forprime (p=2, oo, n++; for (b=1, #s, if (!a[b], s[b]+=(-1)^bittest(p, b-1); if (s[b]==0, a[b]=n; while (a[u], print1 (a[u]", "); u++; if (u>#a, break(3))))))) }
(Python)
from sympy import primepi
n2, t1 = 2**(n-1), 0
k = n2 - 1
kp = primepi(k)
kp2 = primepi(k+n2)-kp
while kp2 < kp or t1 >= kp:
k += n2
t1, t2 = kp, kp2
kp2 = primepi(k+n2) - kp2
kp = t2
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|