login
Sums of area and perimeter of Pythagorean triples, sorted in increasing order, including duplicates.
2

%I #41 Sep 06 2023 13:41:26

%S 18,48,60,90,100,140,144,180,210,270,280,288,294,320,360,378,448,462,

%T 480,594,600,648,660,720,728,756,858,900,900,924,980,1008,1008,1078,

%U 1080,1120,1170,1210,1260,1344,1496,1530,1530,1568,1584,1584,1680,1700,1728

%N Sums of area and perimeter of Pythagorean triples, sorted in increasing order, including duplicates.

%H Giovanni Resta, <a href="/A105520/b105520.txt">Table of n, a(n) for n = 1..10711</a> (terms < 10^7)

%H Douglas Butler, <a href="https://www.tsm-resources.com/tsm/lists/trip.html">Pythagorean triples [including multiples] up to 2100</a>, Oundle School iCT Training Centre.

%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html#anyint">Pythagorean triples</a>.

%e a(28) = 900 = (18+80+82) + (18*80/2) for 18*18 + 80*80 = 82*82.

%e a(29) = 900 = (25+60+65) + (25*60/2) for 25*25 + 60*60 = 65*65.

%e a(32) = 1008 = (24+70+74) + (24*70/2) for 24*24 + 70*70 = 74*74.

%e a(33) = 1008 = (36+48+60) + (36*48/2) for 36*36 + 48*48 = 60*60.

%t L = {}; mx = 1728; Do[ Do[ If[ IntegerQ[z = Sqrt[x^2 + y^2]], v = x y/2 + x + y + z; If[v <= mx, AppendTo[L, v], Break[]]], {y, x-1}], {x, 4, 4 + (2 mx^2)^(1/3)}]; Sort@ L (* _Giovanni Resta_, Mar 16 2020 *)

%o (Rexx)

%o T. = 0 ; S = ''

%o do C = 1 to 999 ; H = C*C

%o do D = 1 to C ; I = D*D

%o do E = 1 to D ; J = E*E

%o if I + J < H then iterate E

%o if I + J = H then do

%o K = T.0 + 1 ; T.0 = K

%o P = C + D + E ; A = ( D * E ) / 2

%o T.K = right( A + P, 6 )

%o T.K = T.K '=' A '+' P '(' E '+' D '+' C ')'

%o end

%o leave E

%o end E

%o end D

%o end C

%o call KWIK 'T.' /* sort by A+P for area A and perimeter P */

%o Y = 0

%o do N = 1 to T.0 while length( S ) < 255

%o X = word( T.N, 1 ) ; say T.N

%o if X <= Y then say 'dupe:' N - 1 N ':' Y X

%o S = S || ', ' || X ; Y = X

%o end N

%o say substr( S, 3 ) /* _Frank Ellermann_, Mar 02 2020 */

%Y Cf. A103605, A103606, A024364, A024406, A105521.

%K easy,nonn

%O 1,1

%A _Alexandre Wajnberg_, May 02 2005

%E Corrected and extended by _Frank Ellermann_, Mar 02 2020