OFFSET
1,2
COMMENTS
From the NW corner to the SE corner, going the upper (or right) way, the edges have lengths n, n-1, ..., 2, 1, 1, 2, ..., n-1, n. Going the lower (or left) way, the edges have lengths n,1,n-1,2,...,2,n-1,1,n.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-5,0,5,-4,1).
FORMULA
a(n) = [(2n^4+10n^3+13n^2+2n)/24], where [] denotes floor. (For even n there is no need for truncation. For odd n the [] removes 1/8.) A formula without [] is (4n^4+20n^3+26n^2+4n+3+3(-1)^(n+1))/48.
From Colin Barker, Oct 07 2015: (Start)
a(n) = 4*a(n-1)-5*a(n-2)+5*a(n-4)-4*a(n-5)+a(n-6) for n>6.
a(n) = (2*n^4+10*n^3+13*n^2+2*n)/24 for n even.
a(n) = (2*n^4+10*n^3+13*n^2+2*n-3)/24 for n odd.
G.f.: -x*(3*x+1) / ((x-1)^5*(x+1)).
(End)
EXAMPLE
For n=6 the figure is (assuming the "#" character is square ...):
######
######
######
######
######
##########
.#########
.#########
.###########
.############
.############
...#############
...#############
...#############
...#############
......###############
......###############
......###############
..........###########
..........###########
...............######
PROG
(PARI) Vec(-x*(3*x+1)/((x-1)^5*(x+1)) + O(x^100)) \\ Colin Barker, Oct 07 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonas Wallgren, Nov 26 2000
EXTENSIONS
More terms from James A. Sellers, Dec 06 2000
STATUS
approved