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
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
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
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
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 A322965 A154570
KEYWORD
sign,easy
AUTHOR
STATUS
approved

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 19 04:58 EDT 2024. Contains 370952 sequences. (Running on oeis4.)