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 A046992 #50 Jan 02 2024 02:39:43 %S A046992 0,1,3,5,8,11,15,19,23,27,32,37,43,49,55,61,68,75,83,91,99,107,116, %T A046992 125,134,143,152,161,171,181,192,203,214,225,236,247,259,271,283,295, %U A046992 308,321,335,349,363,377,392,407,422,437,452,467,483,499,515,531,547,563,580,597,615,633,651,669 %N A046992 a(n) = Sum_{k=1..n} pi(k) (cf. A000720). %C A046992 a(n) = A002815(n) - n. - _Reinhard Zumkeller_, Feb 25 2012 %C A046992 From _Hieronymus Fischer_, Sep 26 2012: (Start) %C A046992 Let S(n) be a string of length n, then a(n) is the number of substrings of S(n) with a prime number of characters. Example 1: "abcd" is a string of length 4; there are a(4)=5 substrings with a prime number of characters (ab, bc, cd, abc and bcd). Example 2: "abcde" is a string of length 5; there are a(5)=8 substrings with a prime number of characters (ab, bc, cd, de, abc, bcd, cde and abcde). %C A046992 Also: If n is represented in base 1 (this means 1=1_1, 2=11_1, 3=111_1, 4=1111_1, etc.), then a(n) is the number of substrings of n with a prime number of digits. Example: 7=1111111_1; the number of prime substrings of 7 (in base 1) is a(7)=15, since there are 15 substrings of prime length: 6 2-digit substrings, 5 3-digit substrings, 3 5-digit substrings and 1 7-digit substring. %C A046992 (End) %H A046992 Hieronymus Fischer, <a href="/A046992/b046992.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe) %F A046992 O.g.f.: A(x)/(1-x)^2 where A(x) = Sum_{p=prime} x^p is the o.g.f. of A010051 and A(x)/(1-x) is the o.g.f. of A000720. - _Geoffrey Critzer_, Dec 04 2011 %F A046992 From _Hieronymus Fischer_, Sep 26 2012: (Start) %F A046992 a(n) = Sum_{p<=n, p is prime} (n - p +1). %F A046992 a(n) = (n+1)*pi(n) - Sum_pi(n), where pi(n) = number of primes <= n and Sum_pi(n) = sum of primes <= n. %F A046992 a(n) = (n+1)*A000720(n) - A034387(n). %F A046992 (End) %F A046992 a(n) ~ n^2 / (2 log n). - _Charles R Greathouse IV_, Mar 03 2017 %t A046992 f[n_] := (f[n - 1] + PrimePi[n]); f[1] = 0; Table[ f[n], {n, 1, 60}] %t A046992 Accumulate[PrimePi[Range[70]]] (* _Harvey P. Dale_, Feb 27 2013 *) %o A046992 (Haskell) %o A046992 a046992 n = a046992_list !! (n-1) %o A046992 a046992_list = scanl1 (+) a000720_list %o A046992 -- _Reinhard Zumkeller_, Feb 25 2012 %o A046992 (PARI) a(n)=my(N=n+1,s); forprime(p=2,n, s+=N-p); s \\ _Charles R Greathouse IV_, Mar 03 2017 %o A046992 (Python) %o A046992 from sympy import primerange %o A046992 def A046992(n): return (n+1)*len(p:=list(primerange(n+1)))-sum(p) # _Chai Wah Wu_, Jan 01 2024 %Y A046992 Cf. A035244, A079397, A213300-A213321. %K A046992 nonn,easy,nice %O A046992 1,3 %A A046992 _N. J. A. Sloane_, _Robert G. Wilson v_ %E A046992 Corrected by _Henry Bottomley_