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.

A179297 a(n) = n^2 - (n-1)^2 - (n-2)^2 - ... - 1^2.

This page as a plain text file.
%I A179297 #31 May 14 2024 10:37:14
%S A179297 1,3,4,2,-5,-19,-42,-76,-123,-185,-264,-362,-481,-623,-790,-984,-1207,
%T A179297 -1461,-1748,-2070,-2429,-2827,-3266,-3748,-4275,-4849,-5472,-6146,
%U A179297 -6873,-7655,-8494,-9392,-10351,-11373,-12460,-13614,-14837,-16131
%N A179297 a(n) = n^2 - (n-1)^2 - (n-2)^2 - ... - 1^2.
%H A179297 Vincenzo Librandi, <a href="/A179297/b179297.txt">Table of n, a(n) for n = 1..1000</a>
%H A179297 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F A179297 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 A179297 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 A179297 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 A179297 1^2-0=1,
%e A179297 2^2-1=3,
%e A179297 3^2-2^2-1=4,
%e A179297 4^2-3^2-2^2-1=2,
%e A179297 5^2-4^2-3^2-2^2-1=-5,
%e A179297 ...
%t A179297 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 A179297 CoefficientList[Series[-(1+x)*(2*x-1)/(x-1)^4,{x,0,50}],x] (* _Vincenzo Librandi_, Jul 04 2012 *)
%t A179297 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 A179297 (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 A179297 Cf. A173142.
%K A179297 sign,easy
%O A179297 1,2
%A A179297 _Vladimir Joseph Stephan Orlovsky_, Jul 09 2010