login
a(n) = Sum_{i=n+1..2n} prime(i) - Sum_{i=1..n} prime(i).
0

%I #22 Sep 01 2019 02:47:44

%S 1,7,21,43,73,115,165,227,301,381,471,569,685,809,937,1089,1247,1425,

%T 1611,1809,2023,2249,2479,2735,2997,3267,3553,3859,4181,4513,4835,

%U 5191,5547,5937,6335,6745,7171,7607,8059,8523,9005,9507,10007,10527

%N a(n) = Sum_{i=n+1..2n} prime(i) - Sum_{i=1..n} prime(i).

%C The analogous sequence for the natural numbers gives the squares.

%F From _Ridouane Oudra_, Aug 31 2019: (Start)

%F a(n) = Sum_{i=1..n} (prime(n+i) - prime(i)), where prime(i) = A000040(i).

%F a(n) = A131740(n) - A007504(n). (End)

%o (PARI) s1=0:s2=0:for(n=1,50,s1=s1+prime(n):s2=s2+prime(2*n)+prime(2*n-1):print1(s2-2*s1","))

%Y Cf. A000040, A131740, A007504.

%K nonn

%O 1,2

%A _Amarnath Murthy_, Nov 05 2002

%E More terms from _Ralf Stephan_, Mar 30 2003

%E Rewrote definition, changed offset. - _N. J. A. Sloane_, Aug 31 2019