Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Jan 08 2024 09:26:23
%S 4,12,24,15,40,60,35,84,112,63,144,180,21,99,220,264,143,312,364,45,
%T 195,420,480,255,56,544,612,77,323,684,80,760,399,840,924,117,483,
%U 1012,1104,55,575,1200,140,1300,165,675,1404,1512,783,176,1624,1740,91,221,899
%N Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, gcd (A, B) = 1, A < B<C); sequence gives values of B, sorted to correspond to increasing A (A020884(n)).
%C The ordered sequence of A values is A020884(n) and the ordered sequence of B values is A020883(n) (allowing repetitions) and A024354(n) (excluding repetitions)
%D Beiler, Albert H.: Recreations In The Theory Of Numbers, Chapter XIV, The Eternal Triangle, Dover Publications Inc., New York, 1964, pp. 104-134.
%D Sierpinski, W.; Pythagorean Triangles, Dover Publications, Inc., Mineola, New York, 2003.
%H Reinhard Zumkeller, <a href="/A156678/b156678.txt">Table of n, a(n) for n = 1..1000</a>
%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html">Right-angled Triangles and Pythagoras' Theorem</a>
%F a(n) = A020884(n) + A156680(n).
%e As the first four primitive Pythagorean triples (ordered by increasing A) are (3,4,5), (5,12,13), (7,24,25) and (8,15,17), then a(1)=4, a(2)=12, a(3)=24 and a(4)=15.
%t PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i<n,If[GCD[i,j]==1,h=Sqrt[i^2+j^2]; If[IntegerQ[h] && j<n,AppendTo[t,{i,j,h}]];];If[j<n,j+=2,i++;j=i+1]];t];k=38;data1=PrimitivePythagoreanTriplets[2k^2+2k+1];data2=Select[data1,#[[1]]<=2k+1 &];#[[2]] &/@data2
%o (Haskell)
%o a156678 n = a156678_list !! (n-1)
%o a156678_list = f 1 1 where
%o f u v | v > uu `div` 2 = f (u + 1) (u + 2)
%o | gcd u v > 1 || w == 0 = f u (v + 2)
%o | otherwise = v : f u (v + 2)
%o where uu = u ^ 2; w = a037213 (uu + v ^ 2)
%o -- _Reinhard Zumkeller_, Nov 09 2012
%Y A020884, A020883, A024354, A156679, A042965, A156680, A156681, A042965.
%Y Cf. A037213.
%K easy,nonn
%O 1,1
%A _Ant King_, Feb 15 2009