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.

Showing 1-5 of 5 results.

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

Views

Author

Eric W. Weisstein, Dec 21 2004

Keywords

Comments

The ratio a(n)/10^n as n->inf is 1/(2*Pi) = 0.15915... (Lehmer). - Tito Piezas III, Aug 11 2006

Examples

			a(1)=1 because there is one primitive solution (a,b,c) as (3,4,5) with c<10^1.
		

Crossrefs

Programs

  • PARI
    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

Extensions

More terms from Jan Feitsma and Bart Dopheide (dopheide(AT)fmf.nl), Mar 10 2005
a(10)-a(11) from Charles R Greathouse IV, Sep 14 2012
a(12) from Charles R Greathouse IV, Oct 15 2012
a(13)-a(19) from Hiroaki Yamanouchi, Jul 14 2014

A101929 Number of Pythagorean triples with hypotenuse < 10^n.

Original entry on oeis.org

1, 50, 878, 12467, 161431, 1980636, 23471468, 271360645, 3080075423, 34465432849, 381301109908, 4179478903380, 45459467009955, 491241450001314, 5278882299478781, 56453500988940599, 601181789833245614, 6378285697775544212
Offset: 1

Views

Author

Eric W. Weisstein, Dec 21 2004

Keywords

Comments

There seems to be a relation between A101930 and this sequence: A101930(n) = n + a(n). - Jan Feitsma and Bart Dopheide (dopheide(AT)fmf.nl), Mar 10 2005
A101930(n) - a(n) = A046080(10^n). The formula listed for A046080 supports the relation of Jan Feitsma and Bart Dopheide: A046080(10^n) = n. - Frank Marcoline (fvmarcoline(AT)gmail.com), Dec 10 2008

Crossrefs

Cf. A101930.

Programs

  • PARI
    a(n)=my(t, lim=10^n-1); 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 15 2012

Formula

a(n) = A101930(n) - n. - Robert G. Wilson v, Mar 20 2014

Extensions

More terms from Jan Feitsma and Bart Dopheide (dopheide(AT)fmf.nl), Mar 10 2005
a(10)-a(11) from Charles R Greathouse IV, Sep 15 2012
a(12)-a(17) from Hiroaki Yamanouchi, Jul 14 2014
a(18) from Matan M. Atzmoni, Feb 04 2023

A386307 Ordered hypotenuses of Pythagorean triples that do not have the form (u^2 - v^2, 2*u*v, u^2 + v^2), where u and v are positive integers.

Original entry on oeis.org

15, 25, 30, 35, 39, 50, 51, 55, 60, 65, 65, 70, 75, 75, 78, 85, 85, 87, 91, 95, 100, 102, 105, 110, 111, 115, 119, 120, 123, 125, 130, 130, 135, 140, 143, 145, 145, 150, 150, 155, 156, 159, 165, 169, 170, 170, 174, 175, 175, 182, 183, 185, 185, 187, 190, 195, 195
Offset: 1

Views

Author

Felix Huber, Aug 13 2025

Keywords

Comments

In the form (u^2 - v^2, 2*u*v, u^2 + v^2), u^2 + v^2) is the hypotenuse, max(u^2 - v^2, 2*u*v) is the long leg and min(u^2 - v^2, 2*u*v) is the short leg.
A101930(n) gives the total number of Pythagorean triples <= 10^n. The percentage of triangles in this sequence increases continuously:
number of terms <= h total number of
h in this sequence hypotenuses <= h percentage
10 0 2 0.0 %
100 21 52 40.4 %
1000 514 881 58.3 %
10000 8629 12471 69.2 %
100000 122431 161436 75.8 %

Examples

			The Pythagorean triple (9, 12, 15) does not have the form (u^2 - v^2, 2*u*v, u^2 + v^2), because 15 is not a sum of two nonzero squares. Therefore 15 is a term.
		

Crossrefs

Programs

  • Maple
    A386307:=proc(N) # To get all hypotenuses <= N
        local i,l,m,u,v,r,x,y,z;
        l:={};
        m:={};
        for u from 2 to floor(sqrt(N-1)) do
            for v to min(u-1,floor(sqrt(N-u^2))) do
                x:=min(2*u*v,u^2-v^2);
                y:=max(2*u*v,u^2-v^2);
                z:=u^2+v^2;
                m:=m union {[z,y,x]};
                if gcd(u,v)=1 and is(u-v,odd) then
                    l:=l union {seq([i*z,i*y,i*x],i=1..N/z)}
                fi
            od
        od;
        r:=l minus m;
        return seq(r[i,1],i=1..nops(r));
    end proc;
    A386307(1000);

Formula

a(n) = sqrt(A386308(n)^2 + A386309(n)^2).
{A009000(n)} = {a(n)} union {A020882(n)} union {A386943(n)}.

A386943 Ordered hypotenuses of nonprimitive Pythagorean triples of the form (u^2 - v^2, 2*u*v, u^2 + v^2), where u and v are positive integers.

Original entry on oeis.org

10, 20, 26, 34, 40, 45, 50, 52, 58, 68, 74, 80, 82, 90, 100, 104, 106, 116, 117, 122, 125, 130, 130, 136, 146, 148, 153, 160, 164, 170, 170, 178, 180, 194, 200, 202, 208, 212, 218, 225, 226, 232, 234, 244, 245, 250, 250, 260, 260, 261, 272, 274, 290, 290, 292, 296
Offset: 1

Views

Author

Felix Huber, Aug 24 2025

Keywords

Comments

In the form (u^2 - v^2, 2*u*v, u^2 + v^2), u^2 + v^2 is the hypotenuse, max(u^2 - v^2, 2*u*v) is the long leg and min(u^2 - v^2, 2*u*v) is the short leg.
A101930(n) gives the total number of Pythagorean triples <= 10^n.
number of terms <= h total number of
h in this sequence hypotenuses <= h percentage
10 1 2 50.0 %
100 15 52 28.8 %
1000 209 881 23.7 %
10000 2249 12471 18.0 %
100000 23086 161436 14.3 %

Examples

			The nonprimitive Pythagorean triple (6, 8, 10) is of the form (u^2 - v^2, 2*u*v, u^2 + v^2): From u = 3 and v = 1 follows u^2 - v^2 = 8 (long leg), 2*u*v = 6 (short leg), u^2 - v^2 = 10 (hypotenuse). Therefore, 10 is a term.
		

Crossrefs

Programs

  • Maple
    A386943:=proc(N) # To get all hypotenuses <= N
        local i,l,u,v;
        l:=[];
        for u from 2 to floor(sqrt(N-1)) do
            for v to min(u-1,floor(sqrt(N-u^2))) do
                if gcd(u,v)>1 or is(u-v,even) then
                    l:=[op(l),[u^2+v^2,max(2*u*v,u^2-v^2),min(2*u*v,u^2-v^2)]]
                fi
            od
        od;
        l:=sort(l);
        return seq(l[i,1],i=1..nops(l));
    end proc;
    A386943(296);

Formula

a(n) = sqrt(A386944(n)^2 + A386945(n)^2).
{A009000(n)} = {a(n)} union {A020882(n)} union {A386307(n)}.

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

Views

Author

Seiichi Manyama, Feb 26 2018

Keywords

Examples

			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]
		

Crossrefs

Programs

  • Ruby
    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-5 of 5 results.