A059329 Number of 3 X 3 matrices, with elements from {0,...,n}, having the property that the middle element of each of the eight 3-element horizontal, vertical and diagonal lines equals the average of the two end elements.
1, 2, 7, 12, 25, 38, 63, 88, 129, 170, 231, 292, 377, 462, 575, 688, 833, 978, 1159, 1340, 1561, 1782, 2047, 2312, 2625, 2938, 3303, 3668, 4089, 4510, 4991, 5472, 6017, 6562, 7175, 7788, 8473, 9158, 9919, 10680, 11521, 12362, 13287, 14212
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Ronald Cools, Ian H. Sloan, Minimial cubature formulae of trigonometric degree, Math. Comp. 65 (216) (1996) 1583-1600. Table 1 dimension 3.
- Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
Programs
-
Mathematica
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 2, 7, 12, 25, 38}, 50] (* G. C. Greubel, Jan 07 2017 *)
-
PARI
a(n)=if(n%2,4*n^3+2*n,4*n^3+6*n^2+8*n+3)/3 \\ Charles R Greathouse IV, Dec 07 2011
Formula
From Frank Ellermann: (Start)
even: a(2*n) = (4*n^3 + 6*n^2 + 8*n + 3)/3.
odd: a(2*n-1) = (4*n^3 + 2*n)/3. (End)
From Colin Barker, Mar 29 2013: (Start)
a(n) = ((1+n)*(9+3*(-1)^n+4*n+2*n^2))/12.
G.f.: (x^2+1)^2 / ((x-1)^4*(x+1)^2). (End)
E.g.f.: (1/12)*(3*(1 - x)*exp(-x) + (9 + 21*x + 12*x^2 + 2*x^3)*exp(x)). - G. C. Greubel, Jan 07 2017
Comments