login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Consider the triangle in which the n-th row starts with n, contains n terms and the difference of successive terms is 1,2,3,... up to n-1. Sequence gives row sums.
2

%I #49 Sep 08 2022 08:45:09

%S 1,3,5,6,5,1,-7,-20,-39,-65,-99,-142,-195,-259,-335,-424,-527,-645,

%T -779,-930,-1099,-1287,-1495,-1724,-1975,-2249,-2547,-2870,-3219,

%U -3595,-3999,-4432,-4895,-5389,-5915,-6474,-7067,-7695,-8359,-9060,-9799,-10577,-11395,-12254,-13155,-14099,-15087,-16120

%N Consider the triangle in which the n-th row starts with n, contains n terms and the difference of successive terms is 1,2,3,... up to n-1. Sequence gives row sums.

%C The triangle whose row sums are being considered is:

%C 1;

%C 2, 1;

%C 3, 2, 0;

%C 4, 3, 1, -2;

%C 5, 4, 2, -1, -5;

%C 6, 5, 3, 0, -4, -9;

%C 7, 6, 4, 1, -3, -8, -14;

%C The leading diagonal is given by A080956(n-1) = n*(3-n)/2.

%H Robert Israel, <a href="/A081498/b081498.txt">Table of n, a(n) for n = 1..10000</a>

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

%F a(n) = n^2 - binomial(n+1, n-2). - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 20 2004

%F a(n) = binomial(n,2)+binomial(n,1)-binomial(n,3). - _Zerinvary Lajos_, Jul 23 2006

%F a(n) = n*(1+6*n-n^2)/6. - _Karen A. Yeats_, Nov 20 2006

%F From _Michael Somos_, Jul 04 2012: (Start)

%F G.f.: x * (1 - x - x^2) / (1 - x)^4.

%F a(-1 - n) = A008778(n). (End)

%F E.g.f.: x*(6 +3*x -x^2)*exp(x)/6. - _G. C. Greubel_, Mar 06 2019

%e G.f. = x * (1 + 3*x + 5*x^2 + 6*x^3 + 5*x^4 + x^5 - 7*x^6 - 20*x^7 - 39*x^8 - 65*x^9 + ...).

%p seq(n^2-binomial(n+1,n-2),n=1..50); # C. Ronaldo

%p [seq(binomial(n,2)+binomial(n,1)-binomial(n,3), n=1..49)]; # _Zerinvary Lajos_, Jul 23 2006

%t LinearRecurrence[{4,-6,4,-1}, {1,3,5,6}, 50] (* _G. C. Greubel_, Mar 06 2019 *)

%o (PARI) {a(n) = if( n< 0, n = -2 - n; polcoeff( (1 + x - x^2) / (1 - x)^4 + x * O(x^n), n), polcoeff( (1 - x - x^2) / (1 - x)^4 + x * O(x^n), n))} /* _Michael Somos_, Jul 04 2012 */

%o (PARI) vector(50, n, n*(1+6*n-n^2)/6) \\ _G. C. Greubel_, Mar 06 2019

%o (GAP) List([1..50],n->n^2-Binomial(n+1,n-2)); # _Muniru A Asiru_, Mar 05 2019

%o (Magma) [n*(1+6*n-n^2)/6: n in [1..50]]; // _G. C. Greubel_, Mar 06 2019

%o (Sage) [n*(1+6*n-n^2)/6 for n in (1..50)] # _G. C. Greubel_, Mar 06 2019

%Y Cf. A008778, A080956, A081499.

%K sign,easy

%O 1,2

%A _Amarnath Murthy_, Mar 25 2003

%E More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 20 2004

%E Offset changed to 1 at the suggestion of _Michel Marcus_, Mar 05 2019

%E Formulas and programs addapted for offset 1 by _Michel Marcus_, Mar 05 2019