login
a(1) = 1+2-3 = 0, a(2) = 4+5+6-7 = 8, a(3) = 8+9+10+11-12 = 26, a(4) = 13+14+15+16+17-18 = 57, ...
2

%I #25 Sep 08 2022 08:45:21

%S 0,8,26,57,104,170,258,371,512,684,890,1133,1416,1742,2114,2535,3008,

%T 3536,4122,4769,5480,6258,7106,8027,9024,10100,11258,12501,13832,

%U 15254,16770,18383,20096,21912,23834,25865,28008,30266,32642,35139,37760

%N a(1) = 1+2-3 = 0, a(2) = 4+5+6-7 = 8, a(3) = 8+9+10+11-12 = 26, a(4) = 13+14+15+16+17-18 = 57, ...

%H Vincenzo Librandi, <a href="/A111694/b111694.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-1)*(n^2 + 5*n + 2)/2.

%F G.f.: x^2*(x-2)*(x-4)/(1-x)^4. - _Colin Barker_, Mar 18 2012

%F a(n) = (n-1)*A034856(n+1). - _R. J. Mathar_, Aug 22 2016

%p seq(sum(j,j=binomial(n+1,2)+n-1..binomial(n+2,2)+n-2) - binomial(n+2,2)-n+1,n=1..50); # _Emeric Deutsch_, Aug 27 2005

%t Table[(n^3 + 4n^2 - 3n - 2)/2, {n, 41}] (* _Robert G. Wilson v_, Aug 27 2005 *)

%o (Magma) [(n^3 + 4*n^2 - 3*n - 2)/2: n in [1..60]]; // _Vincenzo Librandi_, May 21 2011

%Y Cf. A034856.

%K nonn,easy

%O 1,2

%A _Amarnath Murthy_, Aug 17 2005

%E Edited and extended by _Emeric Deutsch_ and _Robert G. Wilson v_, Aug 27 2005