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.

A377897 Numbers k such that k + PrimePi(k) is even.

This page as a plain text file.
%I A377897 #20 Nov 14 2024 05:31:41
%S A377897 4,5,8,10,11,14,16,17,20,22,23,25,27,30,31,33,35,38,40,41,44,46,47,49,
%T A377897 51,54,56,58,59,62,64,66,67,69,72,73,75,77,80,82,83,85,87,90,92,94,96,
%U A377897 97,99,102,103,105,108,109,111,114,116,118,120,122,124,126,127,129,132,134,136,137,140
%N A377897 Numbers k such that k + PrimePi(k) is even.
%H A377897 Paolo Xausa, <a href="/A377897/b377897.txt">Table of n, a(n) for n = 1..10000</a>
%t A377897 Select[Range[200], EvenQ[# + PrimePi[#]] &] (* _Paolo Xausa_, Nov 13 2024 *)
%o A377897 (Python)
%o A377897 from sympy import nextprime
%o A377897 def A377897_gen(): # generator of terms
%o A377897     p,q,a = 3,5,1
%o A377897     while True:
%o A377897         yield from range(p+a,q,2)
%o A377897         p, q, a = q, nextprime(q), a^1
%o A377897 A377897_list = list(islice(A377897_gen(),69)) # _Chai Wah Wu_, Nov 13 2024
%o A377897 (Python)
%o A377897 from sympy import primepi, prevprime
%o A377897 def A377897(n):
%o A377897     def f(x):
%o A377897         if x<=3: return n+x
%o A377897         p = prevprime(x+1)
%o A377897         i = int(primepi(p))
%o A377897         return n+x-(p>>1)-(x-p-((i^x)&1)>>1)
%o A377897     m, k = n, f(n)
%o A377897     while m != k: m, k = k, f(k)
%o A377897     return m # _Chai Wah Wu_, Nov 13 2024
%Y A377897 Cf. A000720, A121053, A377994 (complement).
%K A377897 nonn
%O A377897 1,1
%A A377897 _N. J. A. Sloane_, Nov 13 2024