A135036 Sums of the products of n consecutive pairs of numbers.
0, 6, 26, 68, 140, 250, 406, 616, 888, 1230, 1650, 2156, 2756, 3458, 4270, 5200, 6256, 7446, 8778, 10260, 11900, 13706, 15686, 17848, 20200, 22750, 25506, 28476, 31668, 35090, 38750, 42656, 46816, 51238, 55930, 60900, 66156, 71706, 77558, 83720
Offset: 1
Examples
For n = 3, the sum of the first 3 pairs is 0*1+2*3+4*5 = 26, the 3rd entry in the sequence. G.f.: 6*x^2 + 26*x^3 + 68*x^4 + 140*x^5 + 250*x^6 + 406*x^7 + 616*x^8 + 888*x^9 + ...
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).
Programs
-
Magma
[(n-1)*n*(4*n+1)/3: n in [1..40]]; // Bruno Berselli, Mar 12 2012
-
Mathematica
Accumulate[Times@@@Partition[Range[0,81],2]] (* or *) LinearRecurrence[ {4,-6,4,-1},{0,6,26,68},40] (* Harvey P. Dale, Jun 20 2013 *) a[ n_] := n (n - 1) (4 n + 1)/3; (* Michael Somos, Oct 15 2015 *) a[ n_] := If[ n >= 0, Length @ FindInstance[ 1 - n <= x <= y <= z <= n - 1 && x - 2 y + z != 0, {x, y, z}, Integers, 10^9], -(Length @ FindInstance[ n <= x < y <= z <= -n && x - 2 y + z != 0, {x, y, z}, Integers, 10^9] + n)]; (* Michael Somos, Oct 15 2015 *)
-
PARI
sumprod(n) = { local(x,s=0); forstep(x=0,n,2, s+=x*(x+1); print1(s",") ) }
-
PARI
{a(n) = n * (n - 1) * (4*n + 1) / 3}; /* Michael Somos, Dec 27 2011 */
Formula
a(n) = 0*1 + 2*3 + 4*5 + ... + 2*n*(2*n + 1).
a(n) = (4*n^3 - 3*n^2 - n)/3 = (n - 1)*n*(4*n + 1)/3.
From R. J. Mathar, Feb 14 2008: (Start)
O.g.f.: 2*x^2*(3 + x)/(1 - x)^4.
a(n) = 2*A016061(n-1). (End)
a(0)=0, a(1)=6, a(2)=26, a(3)=68, a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4). - Harvey P. Dale, Jun 20 2013
From Amiram Eldar, Apr 30 2023: (Start)
Sum_{n>=2} 1/a(n) = 6*Pi/5 + 36*log(2)/5 - 213/25.
Sum_{n>=2} (-1)^n/a(n) = 6*sqrt(2)*Pi/5 + 6*(sqrt(2)+3)*log(2)/5 - 12*sqrt(2)*log(2-sqrt(2))/5 - 267/25. (End)
E.g.f.: exp(x)*x^2*(9 + 4*x)/3. - Stefano Spezia, Jun 14 2023
Extensions
First formula corrected by Harvey P. Dale, Jun 20 2013
Comments