cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A105520 #41 Sep 06 2023 13:41:26
%S A105520 18,48,60,90,100,140,144,180,210,270,280,288,294,320,360,378,448,462,
%T A105520 480,594,600,648,660,720,728,756,858,900,900,924,980,1008,1008,1078,
%U A105520 1080,1120,1170,1210,1260,1344,1496,1530,1530,1568,1584,1584,1680,1700,1728
%N A105520 Sums of area and perimeter of Pythagorean triples, sorted in increasing order, including duplicates.
%H A105520 Giovanni Resta, <a href="/A105520/b105520.txt">Table of n, a(n) for n = 1..10711</a> (terms < 10^7)
%H A105520 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 A105520 Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html#anyint">Pythagorean triples</a>.
%e A105520 a(28) = 900 = (18+80+82) + (18*80/2) for 18*18 + 80*80 = 82*82.
%e A105520 a(29) = 900 = (25+60+65) + (25*60/2) for 25*25 + 60*60 = 65*65.
%e A105520 a(32) = 1008 = (24+70+74) + (24*70/2) for 24*24 + 70*70 = 74*74.
%e A105520 a(33) = 1008 = (36+48+60) + (36*48/2) for 36*36 + 48*48 = 60*60.
%t A105520 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 A105520 (Rexx)
%o A105520 T. = 0                        ;  S = ''
%o A105520 do C = 1 to 999               ;  H = C*C
%o A105520    do D = 1 to C              ;  I = D*D
%o A105520       do E = 1 to D           ;  J = E*E
%o A105520          if I + J < H   then  iterate E
%o A105520          if I + J = H   then  do
%o A105520             K = T.0 + 1       ;  T.0 = K
%o A105520             P = C + D + E     ;  A = ( D * E ) / 2
%o A105520             T.K = right( A + P, 6 )
%o A105520             T.K = T.K '=' A '+' P '(' E '+' D '+' C ')'
%o A105520          end
%o A105520          leave E
%o A105520       end E
%o A105520    end D
%o A105520 end C
%o A105520 call KWIK 'T.' /* sort by A+P for area A and perimeter P */
%o A105520 Y = 0
%o A105520 do N = 1 to T.0 while length( S ) < 255
%o A105520    X = word( T.N, 1 )         ;  say T.N
%o A105520    if X <= Y   then  say 'dupe:' N - 1 N ':' Y X
%o A105520    S = S || ', ' || X         ;  Y = X
%o A105520 end N
%o A105520 say substr( S, 3 )            /* _Frank Ellermann_, Mar 02 2020 */
%Y A105520 Cf. A103605, A103606, A024364, A024406, A105521.
%K A105520 easy,nonn
%O A105520 1,1
%A A105520 _Alexandre Wajnberg_, May 02 2005
%E A105520 Corrected and extended by _Frank Ellermann_, Mar 02 2020