OFFSET
1,1
COMMENTS
For each positive real number r, there is a sequence (a(n),b(n),c(n)) of primitive Pythagorean triples such that the limit of b(n)/a(n) is r and
|r-b(n+1)/a(n+1)| < |r-b(n)/a(n)|. Peter Shiu showed how to find (a(n),b(n)) from the continued fraction for r, and Peter J. C. Moses incorporated Shiu's method in the Mathematica program shown below.
Examples:
r...........a(n)..........b(n)..........c(n)
LINKS
Ron Knott, Pythagorean Angles
Peter Shiu, The shapes and sizes of Pythagorean triangles, The Mathematical Gazette 67, no. 439 (March 1983) 33-38.
EXAMPLE
For r=sqrt(2), the first five fractions b(n)/a(n) can be read from the following five primitive Pythagorean triples (a(n), b(n), c(n)) = (A195500, A195501, A195502):
(3,4,5); |r - b(1)/a(1)| = 0.08...
(228,325,397); |r - b(2)/a(2)| = 0.011...
(308,435,533); |r - b(3)/a(3)| = 0.0018...
(5289,7480,9161); |r - b(4)/a(4)| = 0.000042...
(543900,769189,942061); |r - b(5)/a(5)| = 0.0000003...
MAPLE
Shiu := proc(r, n)
t := r+sqrt(1+r^2) ;
cf := numtheory[cfrac](t, n+1) ;
mn := numtheory[nthconver](cf, n) ;
(mn-1/mn)/2 ;
end proc:
A195500 := proc(n)
Shiu(sqrt(2), n) ;
denom(%) ;
end proc: # R. J. Mathar, Sep 21 2011
MATHEMATICA
r = Sqrt[2]; z = 18;
p[{f_, n_}] := (#1[[2]]/#1[[
1]] &)[({2 #1[[1]] #1[[2]], #1[[1]]^2 - #1[[
2]]^2} &)[({Numerator[#1], Denominator[#1]} &)[
Array[FromContinuedFraction[
ContinuedFraction[(#1 + Sqrt[1 + #1^2] &)[f], #1]] &, {n}]]]];
{a, b} = ({Denominator[#1], Numerator[#1]} &)[
Sqrt[a^2 + b^2] (* A195502 *)
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Clark Kimberling, Sep 20 2011
STATUS
approved