OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Don Coppersmith, Ponder This: IBM Research Monthly Puzzles, March 2004 challenge
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = 2*n*(n^2 + 3*n - 1) = 2*n*A014209(n). More generally, number of m X n (0, 1) matrices such that each row and each column is increasing or decreasing is 2*n*(2*binomial(n+m-1, n)-m) = 2*m*(2*binomial(m+n-1, m)-n).
G.f.: 6*x*(1 + 2*x - x^2)/(1-x)^4. - Vincenzo Librandi, Jun 24 2012
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jun 24 2012
MATHEMATICA
CoefficientList[Series[6*(1+2x-x^2)/(1-x)^4, {x, 0, 40}], x] (* Vincenzo Librandi, Jun 24 2012 *)
PROG
(Magma) I:=[6, 36, 102, 216]; [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, Jun 24 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Baltic, Vladeta Jovovic, Jul 10 2003
STATUS
approved