login
A282329
Start with 2, then successively subtract the primes 3, 5, 7, ...
1
2, -1, -6, -13, -24, -37, -54, -73, -96, -125, -156, -193, -234, -277, -324, -377, -436, -497, -564, -635, -708, -787, -870, -959, -1056, -1157, -1260, -1367, -1476, -1589, -1716, -1847, -1984, -2123, -2272, -2423, -2580, -2743, -2910
OFFSET
1,1
FORMULA
a(n) = A007504(n+1) - 2*A071148(n-1).
EXAMPLE
a(1) = 2 - 3 = -1;
a(2) = 2 - 3 - 5 = -6.
MATHEMATICA
FoldList[#1 - #2 &, 2, Prime@ Range[2, 39]] (* Michael De Vlieger, Feb 12 2017 *)
PROG
(Python) from sympy import prime, isprime
sub=2
print(sub, end=", ")
for i in range (3, 200, 2):
if (isprime(i)==True):
sub=sub-i
print(sub, end=", ")
(PARI) lista(nn) = {s = prime(1); print1(s, ", "); for (n=2, nn, s -= prime(n); print1(s, ", "); ); } \\ Michel Marcus, Feb 12 2017
CROSSREFS
KEYWORD
sign
AUTHOR
Frederic Isenmann, Feb 12 2017
STATUS
approved