A101931
Number of primitive Pythagorean triples with hypotenuse < 10^n.
Original entry on oeis.org
1, 16, 158, 1593, 15919, 159139, 1591579, 15915492, 159154994, 1591549475, 15915494180, 159154943063, 1591549430580, 15915494309496, 159154943089963, 1591549430916326, 15915494309190251, 159154943091887752, 1591549430918979115
Offset: 1
a(1)=1 because there is one primitive solution (a,b,c) as (3,4,5) with c<10^1.
-
a(n)=my(t,lim=10^n);for(m=2,sqrtint(lim-1),forstep(n=1+m%2,min(sqrtint(lim-m^2),m-1),2,if(gcd(m,n)==1,t++)));t \\ Charles R Greathouse IV, Sep 13 2012
More terms from Jan Feitsma and Bart Dopheide (dopheide(AT)fmf.nl), Mar 10 2005
A101930
Number of Pythagorean triples with hypotenuse <= 10^n.
Original entry on oeis.org
2, 52, 881, 12471, 161436, 1980642, 23471475, 271360653, 3080075432, 34465432859, 381301109919, 4179478903392, 45459467009968, 491241450001328, 5278882299478796, 56453500988940615, 601181789833245631, 6378285697775544230
Offset: 1
-
a(n)=my(t,lim=10^n);for(m=2,sqrtint(lim-1),forstep(n=1+m%2,min(sqrtint(lim-m^2),m-1),2,if(gcd(m,n)==1,t+=lim\(m^2+n^2))));t \\ Charles R Greathouse IV, Sep 13 2012
Corrected by Todd Stedl (tstedl(AT)speakeasy.net), Jan 15 2005
More terms from Jan Feitsma and Bart Dopheide (dopheide(AT)fmf.nl), Mar 10 2005
A239581
Number of primitive Pythagorean triangles (x, y, z) with legs x < y < 10^n.
Original entry on oeis.org
1, 18, 179, 1788, 17861, 178600, 1786011, 17860355, 178603639, 1786036410, 17860362941
Offset: 1
a(1) = 1, because the only primitive Pythagorean triangle with x < y < 10 is [3, 4, 5].
A239744
Number of Pythagorean triangles (x, y, z) with legs x < y <= 10^n.
Original entry on oeis.org
2, 63, 1034, 14474, 185864, 2269788, 26809924, 309224756, 3503496007, 39147452729, 432599522197
Offset: 1
a(1) = 2, because the only two Pythagorean triangles with x < y < 10 are [3, 4, 5] and [6, 8, 10].
A239786
Number of Pythagorean triangles (x, y, z) with legs x < y < 10^n.
Original entry on oeis.org
2, 62, 1032, 14471, 185860, 2269783, 26809918, 309224749, 3503495999, 39147452720, 432599522187
Offset: 1
A299706
Number of Pythagorean triples with perimeter <= 10^n.
Original entry on oeis.org
0, 17, 325, 4858, 64741, 808950, 9706567, 113236940, 1294080089, 14557915466
Offset: 1
n = 2
perimeter | Pythagorean triple
-------------------------------
12 | [ 3, 4, 5]
30 | [ 5, 12, 13]
24 | [ 6, 8, 10]
56 | [ 7, 24, 25]
40 | [ 8, 15, 17]
36 | [ 9, 12, 15]
90 | [ 9, 40, 41]
60 | [10, 24, 26]
48 | [12, 16, 20]
84 | [12, 35, 37]
60 | [15, 20, 25]
90 | [15, 36, 39]
80 | [16, 30, 34]
72 | [18, 24, 30]
70 | [20, 21, 29]
84 | [21, 28, 35]
96 | [24, 32, 40]
-
def f(a, b, c, n)
return 0 if a + b + c > n
s = n / (a + b + c)
s += f( a - 2 * b + 2 * c, 2 * a - b + 2 * c, 2 * a - 2 * b + 3 * c, n)
s += f( a + 2 * b + 2 * c, 2 * a + b + 2 * c, 2 * a + 2 * b + 3 * c, n)
s += f(-a + 2 * b + 2 * c, -2 * a + b + 2 * c, -2 * a + 2 * b + 3 * c, n)
return s
end
def A299706(n)
(1..n).map{|i| f(3, 4, 5, 10 ** i)}
end
p A299706(8)
Showing 1-6 of 6 results.
Comments