本源勾股数
题解
本源勾股数$(x,y,z)$满足:
$x^2+y^2=z^2$
$gcd(x,y,z)=1$
$x,y,z \in Z^+$
本源勾股数$(x,y,z)$可用以下公式推导:
$x=m^2-n^2$
$y=2mn$
$z=m^2+n^2$
其中$(m,n)$满足:
$m>n$
$gcd(m,n)=1$
$ m+n \equiv 1 (mod \ 2) $
$m,n \in Z^+$
其中寻找互质数对$(m,n)$需要用到$Stern-Brocot \ Tree$
前若干项:$(3,4,5), (5,12,13), (8,15,17), (7,24,25), (20,21,29), (9,40,41)$
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment