login
a(n) = A007504(n) - A046992(n).
1

%I #12 Jan 02 2024 02:40:29

%S 2,4,7,12,20,30,43,58,77,102,128,160,195,232,273,320,372,426,485,548,

%T 613,684,758,838,926,1018,1112,1210,1309,1412,1528,1648,1774,1902,

%U 2040,2180,2325,2476,2631,2792,2958,3126,3303,3482,3665,3850,4046,4254,4466

%N a(n) = A007504(n) - A046992(n).

%t Table[Sum[Prime[n], {n, 1, m}] - Sum[PrimePi[n], {n, 1, m}], {m, 1, 50}]

%o (Python)

%o from sympy import prime, primerange

%o def A122515(n): return -(n+1)*len(p:=list(primerange(n+1)))+(sum(p)<<1)+sum(primerange(n+1,prime(n)+1)) # _Chai Wah Wu_, Jan 01 2024

%Y Cf. A007504, A046992.

%K nonn

%O 1,1

%A _Roger L. Bagula_, Sep 16 2006

%E Edited by _N. J. A. Sloane_, Sep 17 2006