OFFSET
1,1
COMMENTS
Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives values of A, sorted.
Each term in this sequence is given by f(m,n) = m^2 - n^2 or g(m,n) = 2mn where m and n are relatively prime positive integers with m > n, m and n not both odd. For example, a(1) = f(2,1) = 2^2 - 1^2 = 3 and a(4) = g(4,1) = 2*4*1 = 8. - Agola Kisira Odero, Apr 29 2016
All powers of 2 greater than 4 (2^2) are terms, and are generated by the function g(m,n) = 2mn. - Torlach Rush, Nov 08 2019
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
P. Alfeld, Pythagorean Triples (broken link)
Nick Exner, Generating Pythagorean Triples. This was originally a Java applet (1998), modified by Michael McKelvey in 2001 and redone as an HTML page with JavaScript by Evan Ramos in 2014.
W. A. Kehowski, Pythagorean Triples.
Ron Knott, Pythagorean Triples and Online Calculators
MATHEMATICA
shortLegs = {}; amx = 99; Do[For[b = a + 1, b < (a^2/2), c = (a^2 + b^2)^(1/2); If[c == IntegerPart[c] && GCD[a, b, c] == 1, AppendTo[shortLegs, a]]; b = b + 2], {a, 3, amx}]; shortLegs (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
PROG
(Haskell)
a020884 n = a020884_list !! (n-1)
a020884_list = f 1 1 where
f u v | v > uu `div` 2 = f (u + 1) (u + 2)
| gcd u v > 1 || w == 0 = f u (v + 2)
| otherwise = u : f u (v + 2)
where uu = u ^ 2; w = a037213 (uu + v ^ 2)
-- Reinhard Zumkeller, Nov 09 2012
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Extended and corrected by David W. Wilson
STATUS
approved