OFFSET
1,1
LINKS
R. H. Hardin, Table of n, a(n) for n = 1..210
FORMULA
Empirical: a(n) = n^4 + 4*n^3 + 4*n^2 + n + 1.
Empirical g.f.: x*(11 + 12*x + 4*x^2 - 4*x^3 + x^4) / (1 - x)^5. - Colin Barker, Jan 13 2019
Proof of empirical formula: There are (n+1)^4 arrays without the constraint. n of them are of the form (x,x+1,x+1,x) with 0 <= x <= n-1, n*(n+1) are of the form (x,x+1,x,y) with 0 <= x<= n-1 and 0<=y<=n, and n*(n+1) are of the form (y,x,x+1,x). That leaves n^4 + 4*n^3 + 4*n^2 + n + 1. - Robert Israel, Nov 28 2019
EXAMPLE
Some solutions for n=9:
2 7 0 3 8 5 3 3 4 5 8 9 9 8 2 4
7 1 3 8 4 1 1 0 8 6 2 5 1 9 2 5
6 0 7 3 1 1 0 5 8 2 0 8 1 4 0 2
2 3 1 4 5 0 9 4 9 2 9 4 8 6 2 9
MAPLE
seq(n^4 + 4*n^3 + 4*n^2 + n + 1, n=1..100); # Robert Israel, Nov 28 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Feb 04 2016
STATUS
approved