OFFSET
0,2
COMMENTS
Conjecture: a(n) is the number of perimeter-magic (hollow) squares of order 3 with magic sum n+3. Order 3 means each of the 4 edges has 3 elements >=1; the square has 8 elements. The elements do not need to be distinct, and squares obtained by rotations are counted only once. The square (read ccw) for magic sum 3 has elements 1 1 1 1 1 1 1 1. The 3 squares with magic sum 4 are 1 1 2 1 1 1 2 1, 1 1 2 1 1 2 1 2 and 1 2 1 2 1 2 1 2. - R. J. Mathar, Mar 08 2025
LINKS
Index entries for linear recurrences with constant coefficients, signature (4,-5,0,5,-4,1).
FORMULA
a(n) = (-1)^n/8 + (n^4 + 6*n^3 + 17*n^2 + 30*n + 21)/24.
a(n) = Sum_{k=0..n} Sum_{j=0..k} Sum_{i=0..j} (i + (-1)^i).
G.f.: ( -1+x-2*x^2 ) / ( (1+x)*(x-1)^5 ). - R. J. Mathar, Mar 08 2025
a(n)+a(n+1) = A116701(n+3)-1. - R. J. Mathar, Mar 08 2025
MATHEMATICA
Accumulate[LinearRecurrence[{3, -2, -2, 3, -1}, {1, 2, 6, 12, 23}, 50]] (* or *) LinearRecurrence[{4, -5, 0, 5, -4, 1}, {1, 3, 9, 21, 44, 82}, 50] (* Harvey P. Dale, Nov 12 2014 *)
CROSSREFS
KEYWORD
easy,nonn,changed
AUTHOR
Paul Barry, May 31 2003
STATUS
approved