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.
%I A024359 #29 Feb 03 2020 11:45:40 %S A024359 0,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,2,1,0,1,1,1,0,1,2,1,0,1,1,2,0, %T A024359 1,2,1,0,2,1,1,0,1,2,1,0,1,2,1,0,2,2,1,0,1,1,2,0,1,3,1,0,1,1,2,0,1,2, %U A024359 2,0,1,1,1,0,2,2,1,0,1,1,1,0,1,3,2,0,2 %N A024359 Number of primitive Pythagorean triangles with short leg n. %C A024359 Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives number of times A takes value n. %C A024359 Number of times n occurs in A020884. %C A024359 a(A139544(n)) = 0; a(A024352(n)) > 0. - _Reinhard Zumkeller_, Nov 09 2012 %H A024359 T. D. Noe, <a href="/A024359/b024359.txt">Table of n, a(n) for n = 1..10000</a> %H A024359 Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html">Pythagorean Triples and Online Calculators</a> %F A024359 a(n) = A024361(n) - A024360(n). - _Ray Chandler_, Feb 03 2020 %t A024359 solns[a_] := Module[{b, c, soln}, soln = Reduce[a^2 + b^2 == c^2 && a < b && c > 0 && GCD[a, b, c] == 1, {b, c}, Integers]; If[soln === False, 0, If[soln[[1, 1]] === b, 1, Length[soln]]]]; Table[solns[n], {n, 100}] %t A024359 (* Second program: *) %t A024359 a[n_] := Module[{s = 0, b, c, d, g}, Do[g = Quotient[n^2, d]; If[d <= g && Mod[d+g, 2] == 0, c = Quotient[d+g, 2]; b = g-c; If[n < b && GCD[b, c] == 1, s++]], {d, Divisors[n^2]}]; s]; Array[a, 100] (* _Jean-François Alcover_, Apr 27 2019, from PARI *) %o A024359 (Haskell) %o A024359 a024359_list = f 0 1 a020884_list where %o A024359 f c u vs'@(v:vs) | u == v = f (c + 1) u vs %o A024359 | u /= v = c : f 0 (u + 1) vs' %o A024359 -- _Reinhard Zumkeller_, Nov 09 2012 %o A024359 (PARI) %o A024359 nppt(a) = { %o A024359 my(s=0, b, c, d, g); %o A024359 fordiv(a^2, d, %o A024359 g=a^2\d; %o A024359 if(d<=g && (d+g)%2==0, %o A024359 c=(d+g)\2; b=g-c; %o A024359 if(a<b && gcd(b, c)==1, s++) %o A024359 ) %o A024359 ); %o A024359 s %o A024359 } %o A024359 vector(100, n, nppt(n)) \\ _Colin Barker_, Oct 25 2015 %Y A024359 Cf. A020884, A024352, A024360, A024361, A132404 (where records occur), A139544. %K A024359 nonn %O A024359 1,20 %A A024359 _David W. Wilson_