OFFSET
1,3
COMMENTS
An alternating version of A318868.
LINKS
Colin Barker, Table of n, a(n) for n = 1..350
FORMULA
a(n) = n*(n mod 2)*(-1)^floor(n/2) + Sum_{i=1..floor(n/2)} (2*i - 1)^(2*i)*(-1)^(i - 1).
EXAMPLE
a(1) = 1;
a(2) = 1^2 = 1;
a(3) = 1^2 - 3 = -2;
a(4) = 1^2 - 3^4 = -80;
a(5) = 1^2 - 3^4 + 5 = -75;
a(6) = 1^2 - 3^4 + 5^6 = 15545;
a(7) = 1^2 - 3^4 + 5^6 - 7 = 15538;
a(8) = 1^2 - 3^4 + 5^6 - 7^8 = -5749256;
a(9) = 1^2 - 3^4 + 5^6 - 7^8 + 9 = -5749247;
a(10) = 1^2 - 3^4 + 5^6 - 7^8 + 9^10 = 3481035145;
a(11) = 1^2 - 3^4 + 5^6 - 7^8 + 9^10 - 11 = 3481035134;
a(12) = 1^2 - 3^4 + 5^6 - 7^8 + 9^10 - 11^12 = -3134947341576; etc .
MATHEMATICA
Table[n*Mod[n, 2]*(-1)^(Floor[n/2]) + Sum[(2*i - 1)^(2*i)*(-1)^(i - 1), {i, Floor[n/2]}], {n, 30}]
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Wesley Ivan Hurt, Sep 18 2018
STATUS
approved