A356356 Triangle of number of rectangles in the interior of the rectangle with vertices (k,0), (0,k), (n,n+k) and (n+k,n), read by rows.
0, 1, 9, 2, 19, 51, 3, 29, 86, 166, 4, 39, 121, 250, 410, 5, 49, 156, 334, 575, 855, 6, 59, 191, 418, 740, 1141, 1589, 7, 69, 226, 502, 905, 1427, 2044, 2716, 8, 79, 261, 586, 1070, 1713, 2499, 3396, 4356, 9, 89, 296, 670, 1235, 1999, 2954, 4076, 5325, 6645
Offset: 1
Examples
Triangle T(n,k) begins: n\k 1 2 3 4 5 6 7 8 9 10 1 0 2 1 9 3 2 19 51 4 3 29 86 166 5 4 39 121 250 410 6 5 49 156 334 575 855 7 6 59 191 418 740 1141 1589 8 7 69 226 502 905 1427 2044 2716 9 8 79 261 586 1070 1713 2499 3396 4356 10 9 89 296 670 1235 1999 2954 4076 5325 6645 For n = 7, k = 3, T(n,k) = (7-3+1)*A330805(3-1) - (7-3)*f(3,2) + 3*(7-3) = 5*51 - 4*19 + 3*4 = 191.
Links
- Evan Robinson, First 100 rows, flattened
- Code Golf Stack Exchange, Related problem of finding the number of squares on a diagonal grid
Programs
-
Julia
function T(n, k) (2*(n-k)*(4*k^3-k)+(4*k^4-k^2-3*k))รท6 end
Comments