login
A377994
Numbers k such that k + PrimePi(k) is odd.
2
1, 2, 3, 6, 7, 9, 12, 13, 15, 18, 19, 21, 24, 26, 28, 29, 32, 34, 36, 37, 39, 42, 43, 45, 48, 50, 52, 53, 55, 57, 60, 61, 63, 65, 68, 70, 71, 74, 76, 78, 79, 81, 84, 86, 88, 89, 91, 93, 95, 98, 100, 101, 104, 106, 107, 110, 112, 113, 115, 117, 119, 121, 123, 125
OFFSET
1,2
MATHEMATICA
Select[Range[200], OddQ[# + PrimePi[#]] &]
PROG
(Python)
from sympy import prevprime, primepi
def A377994(n):
def f(x):
if x<=3: return n
p = prevprime(x+1)
i = int(primepi(p))
return n+(p>>1)+(x-p-((i^x)&1)>>1)
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Nov 13 2024
(Python)
from sympy import nextprime
def A377994_gen(): # generator of terms
p, q, a = 3, 5, 0
yield from (1, 2)
while True:
yield from range(p+a, q, 2)
p, q, a = q, nextprime(q), a^1
A377994_list = list(islice(A377994_gen(), 40)) # Chai Wah Wu, Nov 13 2024
CROSSREFS
Complement of A377897.
Cf. A000720.
Sequence in context: A029467 A029515 A061951 * A346301 A341257 A153348
KEYWORD
nonn,easy
AUTHOR
Paolo Xausa, Nov 13 2024
STATUS
approved