login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A089594 Alternating sum of squares to n. 13

%I #52 Jan 31 2023 08:30:29

%S -1,3,-6,10,-15,21,-28,36,-45,55,-66,78,-91,105,-120,136,-153,171,

%T -190,210,-231,253,-276,300,-325,351,-378,406,-435,465,-496,528,-561,

%U 595,-630,666,-703,741,-780,820,-861,903,-946,990,-1035,1081,-1128,1176,-1225,1275

%N Alternating sum of squares to n.

%C 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

%C Also triangular numbers with alternating signs. - _Stanislav Sykora_, Nov 26 2013

%H Vincenzo Librandi, <a href="/A089594/b089594.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-3,-3,-1).

%F From _R. J. Mathar_, Nov 05 2011: (Start)

%F a(n) = Sum_{i=1..n} (-1)^i*i^2 = (-1)^n*n*(n+1)/2.

%F G.f.: -x / (1+x)^3. (End)

%F a(n) = (-1)^n*det(binomial(i+2,j+1), 1 <= i,j <= n-1). - _Mircea Merca_, Apr 06 2013

%F 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

%F E.g.f.: (1/2)*x*(x-2)*exp(-x). - _G. C. Greubel_, Mar 31 2021

%F Sum_{n>=1} 1/a(n) = 2 - 4*log(2). - _Amiram Eldar_, Jan 31 2023

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

%p seq(sum(binomial(n,m), m=1..2)-n^2,n=2..51); # _Zerinvary Lajos_, Jun 19 2008

%p A089594 := n -> (-1)^n*n*(n+1)/2; # _Peter Luschny_, Jul 08 2011

%t nn = Range[50]; Accumulate[(-1)^nn*nn^2] (* _Jayanta Basu_, Jun 06 2013 *)

%o (PARI) for(i=1,50, print1(","sum(j=1,i,(-1)^j*j^2)))

%o (PARI) a(n)=(-1)^n*n*(n+1)/2 \\ _Charles R Greathouse IV_, Jul 08 2011

%o (Magma) [(-1)^n*n*(n+1)/2: n in [1..50]]; // _Vincenzo Librandi_, Nov 16 2011

%o (Sage) [(-1)^n*binomial(n+1,2) for n in (1..50)] # _G. C. Greubel_, Mar 31 2021

%Y 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).

%Y Cf. A000217.

%Y Cf. A225144. [_Bruno Berselli_, Jun 06 2013]

%K sign,easy

%O 1,2

%A _Jon Perry_, Dec 30 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)