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!)
A179297 a(n) = n^2 - (n-1)^2 - (n-2)^2 - ... - 1^2. 4

%I #29 Apr 02 2023 12:50:20

%S 1,3,4,2,-5,-19,-42,-76,-123,-185,-264,-362,-481,-623,-790,-984,-1207,

%T -1461,-1748,-2070,-2429,-2827,-3266,-3748,-4275,-4849,-5472,-6146,

%U -6873,-7655,-8494,-9392,-10351,-11373,-12460,-13614,-14837,-16131

%N a(n) = n^2 - (n-1)^2 - (n-2)^2 - ... - 1^2.

%H Vincenzo Librandi, <a href="/A179297/b179297.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1). [From _R. J. Mathar_, Jul 11 2010]

%F G.f.: x*(1+x)*(1-2*x)/(1-x)^4. a(n) = -n*(1-9*n+2*n^2)/6 = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4). [From _R. J. Mathar_, Jul 11 2010]

%F a(0)=1, a(1)=3, a(2)=4, a(3)=2, a(n)=4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) From _Harvey P. Dale_, Jul 11 2012

%F a(n) = -(A000330(n) - A000326(n) - A000217(n)), for n > 0. Or by name equals negative of: "Square Pyramidal" - "Pentagonal" - "Triangular". - _Richard R. Forberg_, Aug 07 2013

%e 1^2-0=1,

%e 2^2-1=3,

%e 3^2-2^2-1=4,

%e 4^2-3^2-2^2-1=2,

%e 5^2-4^2-3^2-2^2-1=-5,

%e ...

%t f[n_]:=Module[{k=n-1,x=n^2},While[k>0,x-=k^2;k--;];x];lst={};Do[AppendTo[lst,f[n]],{n,5!}];lst

%t CoefficientList[Series[-(1+x)*(2*x-1)/(x-1)^4,{x,0,50}],x] (* _Vincenzo Librandi_, Jul 04 2012 *)

%t nn=40;Module[{lst=Range[nn]^2,sublst},Table[sublst=Take[lst,n];Last[ sublst]- Total[Most[sublst]],{n,nn}]] (* or *) LinearRecurrence[ {4,-6,4,-1},{1,3,4,2},40] (* _Harvey P. Dale_, Jul 11 2012 *)

%o (Magma) I:=[1, 3, 4, 2]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // _Vincenzo Librandi_, Jul 04 2012

%Y Cf. A173142.

%K sign,easy

%O 1,2

%A _Vladimir Joseph Stephan Orlovsky_, Jul 09 2010

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 March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)