A328712 Number of non-primitive Pythagorean triples with hypotenuse n.
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1
Offset: 1
Keywords
Examples
n=5 as hypotenuse in only one primitive Pythagorean triple, (3,4,5); so a(5)=0. n=10 as hypotenuse in only one non-primitive Pythagorean triple, (6,8,10); so a(10)=1. n=25 as hypotenuse in one primitive Pythagorean triple (7,24,25) and in one non-primitive Pythagorean triple (15,20,25); so a(25)=1.
References
- A. Beiler, Recreations in the Theory of Numbers. New York: Dover Publications, pp. 116-117, 1966.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local R; if isprime(n) then return 0 fi; R:= map(t -> subs(t,[x,y]),[isolve(x^2+y^2=n^2)]); nops(select(t -> t[1]>=1 and t[2]>=t[1] and igcd(t[1],t[2])>1, R)) end proc: map(f, [$1..100]); # Robert Israel, Oct 31 2019
-
Mathematica
a[n_] := Module[{R, x, y}, If[PrimeQ[n], 0, R = Solve[GCD[x, y] > 1 && x >= 1 && y >= x && x^2 + y^2 == n^2, {x, y}, Integers]; Length[R]]]; Array[a, 102] (* Jean-François Alcover, Jun 20 2020, after Maple *)
Comments