OFFSET
0,5
LINKS
Alois P. Heinz, Antidiagonals n = 0..17, flattened
EXAMPLE
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, ...
1, 2, 2, 2, 2, 2, ...
1, 9, 4, 4, 4, 4, ...
1, 32, 21, 8, 8, 8, ...
1, 121, 92, 45, 16, 16, ...
1, 450, 320, 248, 93, 32, ...
1, 1681, 1213, 1032, 668, 189, ...
1, 6272, 4822, 3524, 3440, 1832, ...
1, 23409, 18556, 13173, 13728, 11976, ...
MAPLE
b:= proc(n, l) option remember; local d, t, k; d:= isqrt(nops(l));
if max(l[])>n then 0 elif n=0 then 1
elif min(l[])>0 then t:=min(l[]); b(n-t, map(x->x-t, l))
else for k while l[k]>0 do od; b(n, subsop(k=d, l))+
`if`(irem(k, d)=1 and {seq(l[k+j], j=1..d-1)}={0},
b(n, [seq(`if`(h-k<d and h-k>=0, 1, l[h]), h=1..nops(l))]), 0)+
`if`(k<=d and {seq(l[k+d*j], j=1..d-1)}={0},
b(n, [seq(`if`(irem(h-k, d)=0, 1, l[h]), h=1..nops(l))]), 0)
fi
end:
A:= (n, k)-> `if`(k>n, 2^n, b(n, [0$k^2])):
seq(seq(A(n, 1+d-n), n=0..d), d=0..11);
MATHEMATICA
b[n_, l_] := b[n, l] = Module[{d, t, k}, d= Sqrt[Length[l]]; Which[ Max[l]>n, 0, n==0, 1, Min[l]>0, t=Min[l]; b[n-t, l-t], True, k=Position[l, 0, 1][[1, 1]]; b[n, ReplacePart[l, k->d]]+ If[Mod[k, d]==1 && Union[ Table[ l[[k+j]], {j, 1, d-1}]] == {0}, b[n, Table[ If [h-k<d && h-k>=0, 1, l[[h]] ], {h, 1, Length[l]}]], 0]+ If[k <= d && Union[ Table[ l[[k+d*j]], {j, 1, d-1}]] == {0}, b[n, Table[ If[ Mod[h-k, d] == 0, 1, l[[h]] ], {h, 1, Length[l]}]], 0] ] ]; a[n_, k_]:= If[k>n, 2^n, b[n, Array[0&, k^2]]]; Table[Table[a[n, 1+d-n], {n, 0, d}], {d, 0, 11}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Dec 07 2013
STATUS
approved