OFFSET
1,1
COMMENTS
(n^2-k^2, 2*k*n, T(n,k)) is a primitive Pythagorean triple iff T(n,k) > 0.
LINKS
G. C. Greubel, Rows n = 1..50 of the triangle, flattened
Eric Weisstein's World of Mathematics, Pythagorean Triple
FORMULA
T(n, n) = 2*A000007(n-1).
T(n, 1) = A002522(n).
T(2*n+1, 2) = A078370(n).
From G. C. Greubel, Dec 15 2022: (Start)
T(n, n-1) = A001844(n).
T(n, n-2) = ((1-(-1)^n)/2) * A008527((n+1)/2).
T(2*n, n) = 5*A000007(n-1).
T(2*n+1, n) = A079273(n+1).
T(2*n-1, n) = A190816(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A053818(n+1) + [n=1]. (End)
EXAMPLE
Triangle begins:
2;
5, 0;
10, 13, 0;
17, 0, 25, 0;
26, 29, 34, 41, 0;
37, 0, 0, 0, 61, 0;
...
MATHEMATICA
Table[If[CoprimeQ[n, k], n^2+k^2, 0], {n, 20}, {k, n}]//Flatten (* Harvey P. Dale, Jul 13 2018 *)
PROG
(Magma)
function A088307(n, k)
if GCD(k, n) eq 1 then return n^2+k^2;
else return 0;
end if; return A088307;
end function;
[A088307(n, k): k in [1..n], n in [1..13]]; // G. C. Greubel, Dec 16 2022
(SageMath)
def A088307(n, k):
if (gcd(n, k)==1): return n^2 + k^2
else: return 0
flatten([[A088307(n, k) for k in range(1, n+1)] for n in range(1, 14)]) # G. C. Greubel, Dec 16 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Reinhard Zumkeller, Nov 05 2003
STATUS
approved