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.
%I A337978 #31 Feb 12 2024 13:29:32 %S A337978 1,1,2,3,4,5,6,7,7,8,10,10,11,12,13,14,15,16,18,19,19,20,21,22,23,24, %T A337978 25,25,27,28,29,29,30,31,32,32,34,35,36,37,38,39,41,42,42,43,44,45,46, %U A337978 47,48,48,50,51,51,52,52,53,55,56,57,58,59,60,60,61,63 %N A337978 a(n) = n + pi(n) - pi(n + pi(n)), where pi(n) is the prime count of n (n>=1). %C A337978 It seems that this is a nondecreasing sequence and a(n) < n for n >= 2. %C A337978 Proofs of the above observations are provided in the Links below. %H A337978 Robert Israel, <a href="/A337978/b337978.txt">Table of n, a(n) for n = 1..10000</a> %H A337978 Ya-Ping Lu, <a href="/A337978/a337978.pdf">Proofs of the two observations in the Comments section</a> %F A337978 a(n) = n + pi(n) - pi(n + pi(n)). %p A337978 f:= n -> n + numtheory:-pi(n) - numtheory:-pi(n + numtheory:-pi(n)): %p A337978 map(f, [$1..100]); # _Robert Israel_, Feb 12 2024 %t A337978 pc[n_]:=With[{c=PrimePi[n]},n+c-PrimePi[n+c]]; Array[pc,70] (* _Harvey P. Dale_, Jan 18 2024 *) %o A337978 (Python) %o A337978 from sympy import primepi %o A337978 print(1) %o A337978 n = 2 %o A337978 for n in range(2, 10001): %o A337978 n_f = n + primepi(n) %o A337978 a = n_f - primepi(n_f) %o A337978 print(a) %o A337978 (PARI) a(n) = {my(x = n + primepi(n)); x - primepi(x); } \\ _Michel Marcus_, Oct 06 2020 %Y A337978 Cf. A000720, A062298, A095117, A337979. %K A337978 nonn %O A337978 1,3 %A A337978 _Ya-Ping Lu_, Oct 06 2020