OFFSET
0,4
FORMULA
T(n,k) = T(k,n).
EXAMPLE
Array begins:
1, 1, 7, 29, 173, 937, 5527, ...
1, 3, 11, 72, 382, 2295, 13391, ...
7, 11, 25, 108, 803, 4632, 29450, ...
29, 72, 108, 241, 1152, 9132, 56043, ...
173, 382, 803, 1152, 2545, 12829, 106207, ...
937, 2295, 4632, 9132, 12829, 28203, 147239, ...
5527, 13391, 29450, 56043, 106207, 147239, 322681, ...
...
T(6,4) = T(5,3) + T(5,4) + T(5,5) + T(6,3) = 9132 + 12829 + 28203 + 56043 =106207.
T(7,5) = T(6,4) + T(6,5) + T(6,6) + T(7,4).
T(7,6) = T(6,6) + T(7,5) + T(6,5).
T(0,5) = T(-1,4) + T(0,4) + T(1,4).
MAPLE
T:= proc(n, k) option remember; `if`([n, k]=[0$2], 1, add(add(
`if`(i^2+j^2<n^2+k^2, T(i, j), 0), j=k-1..k+1), i=n-1..n+1))
end:
seq(seq(T(n, d-n), n=0..d), d=0..8); # Alois P. Heinz, Sep 08 2021
MATHEMATICA
rodean[{m_, n_}] := Select[ Complement[ Flatten[Table[{m, n} + {s, t}, {s, -1, 1}, {t, -1, 1}], 1] // Union, {{m, n}}], #[[1]]^2 + #[[2]]^2 < m^2 + n^2 &];
$RecursionLimit = 10^6; Clear[T]; T[{0, 0}] = 1;
T[{m_, n_}] := T[{m, n}] = Sum[T[rodean[{m, n}][[i]]], {i, Length[rodean[{m, n}]]}] ;
Table[T[{k, n - k}], {n, 0, 12}, {k, 0, n}] // Flatten
(* Second program: *)
T[n_, k_] := T[n, k] = If[{n, k} == {0, 0}, 1, Sum[Sum[If[i^2 + j^2 < n^2 + k^2, T[i, j], 0], {j, k - 1, k + 1}], {i, n - 1, n + 1}]];
Table[Table[T[n, d - n], {n, 0, d}], {d, 0, 8}] // Flatten (* Jean-François Alcover, Nov 03 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
José María Grau Ribas, Jul 23 2021
STATUS
approved