cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A377994 Numbers k such that k + PrimePi(k) is odd.

This page as a plain text file.
%I A377994 #10 Nov 13 2024 18:29:22
%S A377994 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,
%T A377994 50,52,53,55,57,60,61,63,65,68,70,71,74,76,78,79,81,84,86,88,89,91,93,
%U A377994 95,98,100,101,104,106,107,110,112,113,115,117,119,121,123,125
%N A377994 Numbers k such that k + PrimePi(k) is odd.
%H A377994 Paolo Xausa, <a href="/A377994/b377994.txt">Table of n, a(n) for n = 1..10000</a>
%t A377994 Select[Range[200], OddQ[# + PrimePi[#]] &]
%o A377994 (Python)
%o A377994 from sympy import prevprime, primepi
%o A377994 def A377994(n):
%o A377994     def f(x):
%o A377994         if x<=3: return n
%o A377994         p = prevprime(x+1)
%o A377994         i = int(primepi(p))
%o A377994         return n+(p>>1)+(x-p-((i^x)&1)>>1)
%o A377994     m, k = n, f(n)
%o A377994     while m != k: m, k = k, f(k)
%o A377994     return m # _Chai Wah Wu_, Nov 13 2024
%o A377994 (Python)
%o A377994 from sympy import nextprime
%o A377994 def A377994_gen(): # generator of terms
%o A377994     p,q,a = 3,5,0
%o A377994     yield from (1,2)
%o A377994     while True:
%o A377994         yield from range(p+a,q,2)
%o A377994         p, q, a = q, nextprime(q), a^1
%o A377994 A377994_list = list(islice(A377994_gen(),40)) # _Chai Wah Wu_, Nov 13 2024
%Y A377994 Complement of A377897.
%Y A377994 Cf. A000720.
%K A377994 nonn,easy
%O A377994 1,2
%A A377994 _Paolo Xausa_, Nov 13 2024