OFFSET
2,2
LINKS
Heinrich Ludwig, Table of n, a(n) for n = 2..1000
Index entries for linear recurrences with constant coefficients, signature (6,-14,14,0,-14,14,-6,1).
FORMULA
a(n) = C(n*(n+1)/2, 3) - floor((n-1)*(n+1)*(2*n-1)/8).
a(n) = C(n*(n+1)/2, 3) - A002717(n-1).
a(n) = (-3+3*(-1)^n+20*n+8*n^2-23*n^3-3*n^4+3*n^5+n^6)/48. - Colin Barker, Jun 09 2014
G.f.: -x^3*(2*x^3-4*x^2+17*x+15) / ((x-1)^7*(x+1)). - Colin Barker, Jun 09 2014
MATHEMATICA
Table[Binomial[n (n + 1)/2, 3] - Floor[(n - 1) (n + 1) (2 n - 1)/8], {n, 2, 40}] (* Vincenzo Librandi, Jun 23 2015 *)
PROG
(PARI) concat(0, Vec(-x^3*(2*x^3-4*x^2+17*x+15)/((x-1)^7*(x+1)) + O(x^100))) \\ Colin Barker, Jun 09 2014
(Magma) I:=[0, 15, 107, 428, 1282, 3198, 7022, 14020]; [n le 8 select I[n] else 6*Self(n-1)-14*Self(n-2)+14*Self(n-3)-14*Self(n-5)+14*Self(n-6)-6*Self(n-7)+Self(n-8): n in [1..40]]; // Vincenzo Librandi, Jun 23 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Heinrich Ludwig, Jun 09 2014
STATUS
approved