%I #26 Jun 19 2022 22:04:29
%S 1,2,2,1,3,3,2,5,5,2,4,4,1,4,4,3,8,8,3,7,7,2,8,8,5,12,12,5,9,9,2,7,7,
%T 4,9,9,4,6,6,1,5,5,4,11,11,4,10,10,3,13,13,8,19,19,8,14,14,3,12,12,7,
%U 16,16,7,11,11,2,11,11,8,21,21,8,18,18,5,19,19
%N Triangle T(n, k) read by rows, n > 0 and 0 < k <= 3^(n-1): T(n, k) = sqrt((A321770(n, k) - A321768(n, k))/2).
%C This sequence and A321782 are related to a parametrization of the primitive Pythagorean triples in the tree described in A321768.
%H Rémy Sigrist, <a href="/A321783/b321783.txt">Rows n = 1..9, flattened</a>
%H Kevin Ryde, <a href="http://user42.tuxfamily.org/triples/index.html">Trees of Primitive Pythagorean Triples</a>, see section UAD Tree, "row-wise q".
%H Robert Saunders and Trevor Randall, <a href="http://www.jstor.org/stable/3618576">The Family Tree of the Pythagorean Triplets Revisited</a>, Mathematical Gazette, item 78.12, volume 78, July 1994, pages 190-193, see page 192 tree terms "n" by columns.
%H <a href="/index/Ps#PyTrip">Index entries related to Pythagorean Triples</a>
%F Empirically:
%F - T(n, 1) = n,
%F - T(n, (3^(n-1) + 1)/2) = A000129(n),
%F - T(n, 3^(n-1)) = 1.
%e The first rows are:
%e 1
%e 2, 2, 1
%e 3, 3, 2, 5, 5, 2, 4, 4, 1
%o (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]];
%o 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))
%Y Cf. A000129, A321768, A321770, A321782.
%Y Cf. A001653 (row sums).
%K nonn,tabf
%O 1,2
%A _Rémy Sigrist_, Nov 19 2018