OFFSET
1,13
COMMENTS
For large N, Benito and Varona have shown that a(N)~2/pi^2 Log(1+sqrt(2)).N +O(sqrt(N)). However, the approximations to a(N)/N are considerably more accurate than the error term suggests, and it certainly appears that the density of the primitive triples with both legs less than N tends towards 2/pi^2 Log(1+sqrt(2))=0.1786... as N becomes large.
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000
Manuel Benito and Juan L. Varona, Pythagorean triangles with legs less than n, Journal of Computational and Applied Mathematics 143, (2002), pp. 117-126.
EXAMPLE
There are two primitive triples with both legs less than 14, specifically (3,4,5) and (5,12,13). Hence a(14)=2.
MATHEMATICA
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]; Append[{0, 0, 0, 0}, Length[PrimitivePythagoreanTriplets[ # ]]&/@Range[5, 50]]//Flatten
(* Second program: *)
Join[{0}, Cases[Import["https://oeis.org/A024360/b024360.txt", "Table"], {_, _}][[;; 10000, 2]]] // Accumulate (* Jean-François Alcover, Mar 27 2020 *)
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
Ant King, Feb 17 2009
STATUS
approved