OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Rows n = 1..9, flattened
Kevin Ryde, Trees of Primitive Pythagorean Triples, see section UAD Tree, "row-wise q".
Robert Saunders and Trevor Randall, The Family Tree of the Pythagorean Triplets Revisited, Mathematical Gazette, item 78.12, volume 78, July 1994, pages 190-193, see page 192 tree terms "n" by columns.
FORMULA
EXAMPLE
The first rows are:
1
2, 2, 1
3, 3, 2, 5, 5, 2, 4, 4, 1
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 (sqrtint((t[3, 1] - t[1, 1])/2))
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Rémy Sigrist, Nov 19 2018
STATUS
approved