cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A089594 Alternating sum of squares to n.

Original entry on oeis.org

-1, 3, -6, 10, -15, 21, -28, 36, -45, 55, -66, 78, -91, 105, -120, 136, -153, 171, -190, 210, -231, 253, -276, 300, -325, 351, -378, 406, -435, 465, -496, 528, -561, 595, -630, 666, -703, 741, -780, 820, -861, 903, -946, 990, -1035, 1081, -1128, 1176, -1225, 1275
Offset: 1

Views

Author

Jon Perry, Dec 30 2003

Keywords

Comments

Let A be the Hessenberg n X n matrix defined by: A[1,j]=j mod 2, A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=3, a(n-1)=(-1)^(n-1)*coeff(charpoly(A,x),x^(n-2)). - Milan Janjic, Jan 24 2010
Also triangular numbers with alternating signs. - Stanislav Sykora, Nov 26 2013

Examples

			a(6) = 1 + 4 - 9 + 16 - 25 + 36 = 3 + 7 + 11 = 21.
		

Crossrefs

Cf. A059841 (p=0,q=-1), A130472 (p=1,q=-1), this sequence (p=2,q=-1), A232599 (p=3,q=-1), A126646 (p=0,q=2), A036799 (p=1,q=2), A036800 (p=2,q=2), A036827 (p=3,q=2), A077925 (p=0,q=-2), A232600 (p=1,q=-2), A232601 (p=2,q=-2), A232602 (p=3,q=-2), A232603 (p=2,q=-1/2), A232604 (p=3,q=-1/2).
Cf. A000217.
Cf. A225144. [Bruno Berselli, Jun 06 2013]

Programs

Formula

From R. J. Mathar, Nov 05 2011: (Start)
a(n) = Sum_{i=1..n} (-1)^i*i^2 = (-1)^n*n*(n+1)/2.
G.f.: -x / (1+x)^3. (End)
a(n) = (-1)^n*det(binomial(i+2,j+1), 1 <= i,j <= n-1). - Mircea Merca, Apr 06 2013
G.f.: -W(0)/(2+2*x), where W(k) = 1 + 1/( 1 - x*(k+2)/( x*(k+2) - (k+1)/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 19 2013
E.g.f.: (1/2)*x*(x-2)*exp(-x). - G. C. Greubel, Mar 31 2021
Sum_{n>=1} 1/a(n) = 2 - 4*log(2). - Amiram Eldar, Jan 31 2023