OFFSET
1,1
COMMENTS
LINKS
FORMULA
EXAMPLE
The first rows are:
12
30, 70, 40
56, 176, 126, 208, 408, 198, 154, 234, 84
T(1,1) corresponds to the perimeter of the triangle with sides 3, 4, 5; hence T(1, 1) = 3 + 4 + 5 = 12.
PROG
(PARI) M = [[1, -2, 2; 2, -1, 2; 2, -2, 3], [1, 2, 2; 2, 1, 2; 2, 2, 3], [-1, 2, 2; -2, 1, 2; -2, 2, 3]];
T(n, k) = my (t=[3; 4; 5], d=digits(3^(n-1)+k-1, 3)); for (i=2, #d, t = M[d[i]+1] * t); return (t[1, 1] + t[2, 1] + t[3, 1])
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Rémy Sigrist, Nov 30 2018
STATUS
approved