A134181 Difference between cumulative prime and odd sums.
0, 0, 0, 2, 4, 8, 12, 18, 28, 38, 52, 68, 84, 102, 124, 150, 176, 206, 238, 270, 306, 344, 386, 434, 484, 534, 586, 638, 692, 758, 826, 898, 970, 1050, 1130, 1214, 1302, 1392, 1486, 1584, 1682, 1788, 1894, 2002, 2110, 2228, 2356, 2486, 2616, 2748, 2884, 3020
Offset: 1
Examples
a(2)=0 because for the prime sequence beginning at 3, the sum is 8 (3+5). For the odd sequence beginning at 3 the sum is also 8 (3+5) and 8-8=0.
Programs
-
Mathematica
lim=52;ps=Accumulate[Prime[Range[2,lim+1]]];os=Accumulate[Range[3,2lim+1,2]];ps-os (* James C. McMahon, Apr 05 2025 *)
-
UBASIC
10 N=1:A=2 20 A=nxtprm(A):B=B+A 30 N=N+2:D=D+N 40 print A;N;B;D;B-D:stop 50 C=C+1: if C<60 then 20
Formula
Beginning with 3 for both the prime and odd sequences, compute cumulative sums of both sequences and take the difference
Comments