This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A179297 a(n) = n^2 - (n-1)^2 - (n-2)^2 - ... - 1^2. 2
 1, 3, 4, 2, -5, -19, -42, -76, -123, -185, -264, -362, -481, -623, -790, -984, -1207, -1461, -1748, -2070, -2429, -2827, -3266, -3748, -4275, -4849, -5472, -6146, -6873, -7655, -8494, -9392, -10351, -11373, -12460, -13614, -14837, -16131 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS Vincenzo Librandi, Table of n, a(n) for n = 1..1000 Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1). [From R. J. Mathar, Jul 11 2010] FORMULA 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] 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 Equals -(A000330(n) - AA000326(n) - A000217(n)), for n > 0.  Or by name equals negative of: "Square Pyramidal" - "Pentagonal" - "Triangular". - Richard R. Forberg, Aug 07 2013 EXAMPLE 1^2-0=1, 2^2-1=3, 3^2-2^2-1=4, 4^2-3^2-2^2-1=2, 5^2-4^2-3^2-2^2-1=-5, ... MATHEMATICA 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 CoefficientList[Series[-(1+x)*(2*x-1)/(x-1)^4, {x, 0, 50}], x] (* Vincenzo Librandi, Jul 04 2012 *) 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 *) PROG (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 CROSSREFS Cf. A173142. Sequence in context: A214929 A205152 A162196 * A133620 A154570 A145961 Adjacent sequences:  A179294 A179295 A179296 * A179298 A179299 A179300 KEYWORD sign,easy AUTHOR Vladimir Joseph Stephan Orlovsky, Jul 09 2010 STATUS approved

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