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-10 of 17 results. Next

A342491 a(n) = f(x)+f(y)+f(z), where (x,y,h) is the n-th Pythagorean triple listed in (A046083, A046084, A009000), and f(m)=A176774(m) is the smallest polygonality of m.

Original entry on oeis.org

12, 14, 23, 12, 28, 29, 27, 20, 38, 52, 27, 22, 11, 47, 20, 49, 53, 16, 69, 81, 17, 47, 59, 59, 34, 41, 93, 32, 76, 33, 34, 121, 76, 93, 88, 33, 37, 39, 101, 102, 83, 27, 90, 52, 73, 183, 75, 37, 45, 130, 105, 15, 155, 83, 120, 54, 106, 133, 129, 15, 123, 42, 225
Offset: 1

Views

Author

Michel Marcus, Mar 14 2021

Keywords

Comments

Inspired by (A245646, A245647, A245648), for which a(n) = 12.
Examples of lower terms: 11 for (21, 28, 35), 10 for (64, 120, 136) and 9 for (8778, 10296, 13530).

Examples

			a(1) = 12 because (3, 4, 5) are (3-, 4-, 5-) gonal numbers, and 3+4+5=12.
		

Crossrefs

Cf. A213188 (see 2nd comment).

Programs

  • PARI
    tp(n) = my(k=3); while( !ispolygonal(n,k), k++); k; \\ A176774
    f(v) = vecsum(apply(tp, v));
    list(lim) = {my(v=List(), m2, s2, h2, h); for(middle=4, lim-1, m2=middle^2; for(small=1, middle, s2=small^2; if(issquare(h2=m2+s2, &h), if(h>lim, break); listput(v, [h, middle, small]);););); v = vecsort(Vec(v)); apply(f, v);} \\ adapted from A009000

Formula

a(n) = f(A046083(n)) + f(A046084(n)) + f(A009000(n)) where f is A176774.

A382931 Numbers k for which the Pythagorean triangle (A046083(k), A046084(k), A009000(k)) has an integer altitude.

Original entry on oeis.org

7, 19, 36, 51, 69, 88, 99, 106, 126, 147, 163, 187, 196, 208, 227, 240, 250, 273, 293, 314, 342, 361, 384, 392, 409, 434, 455, 459, 483, 504, 507, 525, 549, 552, 579, 599, 627, 649, 679, 702, 711, 718, 724, 744, 752, 775, 802, 829, 854, 879, 894, 908, 935, 960
Offset: 1

Views

Author

Felix Huber, Apr 11 2025

Keywords

Comments

Let (a, b, c) be a primitive Pythagorean triple. Since gcd(a, b, c) = 1, all and only the Pythagorean triples (k*c*a, k*c*b, k*c^2) have an integer altitude h = (k*c*a*k*c*b)/(k*c^2) = k*a*b, where k is a positive integer.

Examples

			7 is in the sequence because the pythagorean triangle (A046083(7), A046084(7), A009000(7)) = (15, 20, 25) has the integer altitude 15*20/25 = 12.
		

Crossrefs

Programs

  • Maple
    A382931:=proc(H) # All hypotenuses <= H.
        local a,b,c,k,p,q,L,M;
        L:=[];
        M:=[];
        for p from 2 to floor(sqrt(H-1)) do
            for q to min(p-1,floor(sqrt(H-p^2))) do
                if gcd(p,q)=1 and is(p-q,odd) then
                    a:=p^2-q^2;
                    b:=2*p*q;
                    c:=p^2+q^2;
                    for k to iquo(H,c) do
                        L:=[op(L),[k*c,k*max(a,b),k*a*b/c]]
                    od
                fi
            od
        od;
        L:=sort(L);
        for k to nops(L) do
            if is(L[k,3],integer) then
               M:=[op(M),k]
            fi
        od;
        return op(M)
    end proc;
    A382931(1075);

A382932 a(n) is the altitude of the Pythagorean triangle (A046083(A382931(n)), A046084(A382931(n)), A009000(A382931(n))).

Original entry on oeis.org

12, 24, 36, 48, 60, 72, 60, 84, 96, 108, 120, 132, 120, 144, 156, 120, 168, 180, 192, 204, 216, 228, 240, 180, 252, 264, 276, 240, 288, 300, 168, 312, 324, 240, 336, 348, 360, 372, 384, 396, 420, 300, 408, 360, 420, 432, 444, 456, 468, 480, 360, 492, 504, 516
Offset: 1

Views

Author

Felix Huber, Apr 13 2025

Keywords

Comments

All terms are divisible by 12. Proof: (Start)
Let (a, b, c) be a primitive Pythagorean triple. Since gcd(a, b, c) = 1, all and only the Pythagorean triples (k*c*a, k*c*b, k*c^2) have an integer altitude h = (k*c*a*k*c*b)/(k*c^2) = k*a*b, where k is a positive integer.
With a = p^2 - q^2 and b = 2*p*q follows h = 2*k*p*q*(p^2 - q^2) = k*2*p*q*(p + q)*(p - q), where p > q > 0, gcd(p,q) = 1 and p or q is even.
It is to show that p*q*(p + q)*(p - q) is divisible by 6. Since p or q is divisible by 2, it remains to show that p*q*(p + q)*(p - q) is divisible by 3.
If 3 is a divisor of p or q, p*q is divisible by 3. If p mod 3 = 1 and q mod 3 = 2 or p mod 3 = 2 and q mod 3 = 1, then p + q is divisible by 3. If p mod 3 = q mod 3 = 1 or p mod 3 = q mod 3 = 2, then p - q is divisible by 3.
It follows that all terms are divisible by 12. (End)

Examples

			a(1) = 12 because the Pythagorean triangle (A046083(A382931(1)), A046084(A382931(1)), A009000(A382931(1))) = (A046083(7), A046084(7), A009000(7)) = (15, 20, 25) has the integer altitude 15*20/25 = 12.
		

Crossrefs

Programs

  • Maple
    A382932:=proc(H) # All hypotenuses <= H.
        local a,b,c,k,p,q,L,M;
        L:=[];
        M:=[];
        for p from 2 to floor(sqrt(H-1)) do
            for q to min(p-1,floor(sqrt(H-p^2))) do
                if gcd(p,q)=1 and is(p-q,odd) then
                    a:=p^2-q^2;
                    b:=2*p*q;
                    c:=p^2+q^2;
                    for k to iquo(H,c) do
                        L:=[op(L),[k*c,k*max(a,b),k*a*b/c]]
                    od
                fi
            od
        od;
        L:=sort(L);
        for k to nops(L) do
            if is(L[k,3],integer) then
               M:=[op(M),L[k,3]]
            fi
        od;
        return op(M)
    end proc;
    A382932(1075);

Formula

A344083 a(n) = f(x)+f(y)+f(z), where (x,y,h) is the n-th Pythagorean triple listed in (A046083, A046084, A009000), and f(m)=A176775(m) is the index of m as k-gonal number for the smallest possible k.

Original entry on oeis.org

6, 9, 7, 11, 9, 9, 12, 10, 9, 10, 9, 11, 18, 10, 16, 9, 9, 20, 9, 7, 18, 9, 18, 15, 11, 14, 7, 12, 10, 13, 12, 7, 12, 15, 12, 17, 14, 18, 13, 9, 13, 14, 15, 10, 9, 7, 9, 21, 12, 10, 15, 23, 7, 9, 12, 20, 9, 18, 17, 28, 14, 16, 7, 21, 18, 24, 21, 21, 20, 16, 25
Offset: 1

Views

Author

Michel Marcus, May 09 2021

Keywords

Comments

6 is the minimum possible value, and A176775(3,4,5) gives this minimum.
Conjecture: there are no other Pythagorean triples that give this minimum. In other words, it is the only triple with 3 A090467 terms.

Crossrefs

Programs

  • PARI
    tp(n) = my(k=3); while( !ispolygonal(n,k), k++); k; \\ A176774
    itp(n) = my(m=tp(n)); (m-4+sqrtint((m-4)^2+8*(m-2)*n)) / (2*m-4); \\ A176775
    f(v) = vecsum(apply(itp, v));
    list(lim) = {my(v=List(), m2, s2, h2, h); for(middle=4, lim-1, m2=middle^2; for(small=1, middle, s2=small^2; if(issquare(h2=m2+s2, &h), if(h>lim, break); listput(v, [h, middle, small]);););); v = vecsort(Vec(v)); apply(f, v);}

A009000 Ordered hypotenuse numbers (squares are sums of 2 distinct nonzero squares).

Original entry on oeis.org

5, 10, 13, 15, 17, 20, 25, 25, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 50, 50, 51, 52, 53, 55, 58, 60, 61, 65, 65, 65, 65, 68, 70, 73, 74, 75, 75, 78, 80, 82, 85, 85, 85, 85, 87, 89, 90, 91, 95, 97, 100, 100, 101, 102, 104, 105, 106, 109, 110, 111, 113, 115, 116, 117, 119, 120
Offset: 1

Views

Author

Keywords

Comments

The largest member 'c' of the Pythagorean triples (a,b,c) ordered by increasing c.
If c^2 = a^2 + b^2 (a < b < c) then c^2 = (n^2 + m^2)/2 with n = b - a, m = b + a. - Zak Seidov, Mar 03 2011
Numbers n such that A083025(n) > 0, i.e., n is divisible by at least one prime of the form 4k+1. - Max Alekseyev, Oct 24 2008
A number appears only once in the sequence if and only if it is divisible by exactly one prime of the form 4k+1 with multiplicity one (cf. A084645). - Jean-Christophe Hervé, Nov 11 2013
If c^2 = a^2 + b^2 with a and b > 0, then a <> b: the sum of 2 equal squares cannot be a square because sqrt(2) is not rational. - Jean-Christophe Hervé, Nov 11 2013

References

  • W. L. Schaaf, Recreational Mathematics, A Guide To The Literature, "The Pythagorean Relationship", Chapter 6 pp. 89-99 NCTM VA 1963.
  • W. L. Schaaf, A Bibliography of Recreational Mathematics, Vol. 2, "The Pythagorean Relation", Chapter 6 pp. 108-113 NCTM VA 1972.
  • W. L. Schaaf, A Bibliography of Recreational Mathematics, Vol. 3, "Pythagorean Recreations", Chapter 6 pp. 62-6 NCTM VA 1973.

Crossrefs

Programs

  • Maple
    A009000:=proc(N) # To get all terms <= N
        local p,q,i,L;
        L:=[];
        for p from 2 to floor(sqrt(N-1)) do
            for q to p-1 do
                if igcd(p,q)=1 and is(p-q,odd) then
                    L:=[op(L),seq(i*(p^2+q^2),i=1..N/(p^2+q^2))];
                fi
            od
        od;
        return op(sort(L))
    end proc:
    A009000(120); # Felix Huber, Feb 10 2025
  • Mathematica
    max = 120; hypotenuseQ[n_] := For[k = 1, True, k++, p = Prime[k]; Which[Mod[p, 4] == 1 && Divisible[n, p], Return[True], p > n, Return[False]]]; hypotenuses = Select[Range[max], hypotenuseQ]; red[c_] := {a, b, c} /. {ToRules[ Reduce[0 < a <= b && a^2 + b^2 == c^2, {a, b}, Integers]]}; A009000 = Flatten[red /@ hypotenuses, 1][[All, -1]] (* Jean-François Alcover, May 23 2012, after Max Alekseyev *)
    Sqrt[#]&/@Flatten[Table[Total/@Select[IntegerPartitions[n^2,{2}],Length[Union[#]]==2&&AllTrue[Sqrt[#],IntegerQ]&],{n,150}]] (* Harvey P. Dale, May 25 2025 *)
  • PARI
    list(lim)=my(v=List(),m2,s2,h2,h); for(middle=4,lim-1, m2=middle^2; for(small=1,middle, s2=small^2; if(issquare(h2=m2+s2,&h), if(h>lim, break); listput(v, h)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jun 23 2017
    
  • PARI
    list(lim) = {my(lh = List()); for(u = 2, sqrtint(lim), for(v = 1, u, if (u^2+v^2 > lim, break); if ((gcd(u,v) == 1) && (0 != (u-v)%2), for (i = 1, lim, if (i*(u^2+v^2) > lim, break); /* if (u^2 - v^2 < 2*u*v, w = [i*(u^2 - v^2), i*2*u*v, i*(u^2+v^2)], w = [i*2*u*v, i*(u^2 - v^2), i*(u^2+v^2)]); */ listput(lh, i*(u^2+v^2)););););); vecsort(Vec(lh));} \\ Michel Marcus, Apr 10 2021
    
  • Python
    from math import isqrt
    def aupto(limit):
      s = [i*i for i in range(1, limit+1)]
      s2 = sorted(a+b for i, a in enumerate(s) for b in s[i+1:])
      return [isqrt(k) for k in s2 if k in s]
    print(aupto(120)) # Michael S. Branicky, May 10 2021

A046084 The middle member 'b' of the Pythagorean triples (a,b,c) ordered by increasing c.

Original entry on oeis.org

4, 8, 12, 12, 15, 16, 20, 24, 24, 21, 24, 30, 28, 35, 36, 32, 40, 36, 40, 48, 45, 48, 45, 44, 42, 48, 60, 52, 56, 60, 63, 60, 56, 55, 70, 60, 72, 72, 64, 80, 68, 75, 77, 84, 63, 80, 72, 84, 76, 72, 80, 96, 99, 90, 96, 84, 90, 91, 88, 105, 112, 92, 84, 108, 105, 96, 120
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    maxHypo = 122; hypotenuseQ[n_] := For[k = 1, True, k++, p = Prime[k]; Which[Mod[p, 4] == 1 && Divisible[n, p], Return[True], p > n, Return[False]]]; hypotenuses = Select[Range[maxHypo], hypotenuseQ]; red[c_] := {a, b, c} /. {ToRules[ Reduce[0 < a <= b && a^2 + b^2 == c^2, {a, b}, Integers]]}; Sort[Flatten[red /@ hypotenuses , 1], Last[#1] < Last[#2] &][[All, 2]] (* Jean-François Alcover, Oct 23 2012 *)

A380074 Short legs of Pythagorean triangles having legs that add up to a square ordered by increasing hypotenuse.

Original entry on oeis.org

21, 9, 84, 36, 133, 85, 189, 81, 189, 184, 336, 144, 400, 217, 532, 525, 340, 225, 820, 756, 324, 756, 736, 1036, 57, 1029, 564, 820, 1197, 672, 765, 441, 1344, 576, 1600, 1701, 868, 2128, 729, 2100, 1701, 1656, 1360, 1464, 2044, 900, 1513, 2541, 781, 2340, 3280
Offset: 1

Views

Author

Felix Huber, Jan 18 2025

Keywords

Comments

Corresponding hypotenuses in A380072, long legs in A380073.
Subsequence of A046083 and supersequence of A089547.

Examples

			21 is in the sequence because 21^2 + 28^2 = 35^2 and 21 + 28 = 7^2.
		

Crossrefs

Programs

  • Maple
    # Calculates the first 10001 terms
    A380074:=proc(M)
        local i,m,p,q,r,u,w,L,F;
        L:=[];
        m:=M^2+2*M+2;
        for p from 2 to M do
            for q to p-1 do
                if gcd(p,q)=1 and (is(p,even) or is(q,even)) then
                    r:=1;
                    for i in ifactors(p^2-q^2+2*p*q)[2] do
                        if is(i[2],odd) then
                            r:=r*i[1]
                        fi
                    od;
                    w:=r*(p^2+q^2);
                    if w<=m then
                        u:=r*min(p^2-q^2,2*p*q);
                        L:=[op(L),seq([i^2*w,i^2*u],i=1..floor(sqrt(m/w)))]
                    fi
                fi
            od
        od;
        F:=[];
        for i in sort(L) do
            F:=[op(F),i[2]]
        od;
        return op(F)
    end proc;
    A380074(4330);

A057098 Shortest side of a Pythagorean triangle (ordered by the product of the sides).

Original entry on oeis.org

3, 6, 5, 9, 8, 12, 7, 10, 15, 20, 18, 9, 12, 16, 21, 15, 24, 14, 11, 27, 20, 24, 30, 16, 28, 33, 13, 40, 25, 36, 21, 18, 33, 24, 32, 39, 42, 30, 15, 48, 20, 45, 36, 48, 40, 35, 28, 39, 51, 22, 60, 54, 17, 27, 40, 57, 36, 48, 65, 60, 24, 32, 35, 56, 63, 45, 60, 19, 66, 44, 56
Offset: 1

Views

Author

Henry Bottomley, Aug 01 2000

Keywords

Examples

			a(1)=3 since 3*4*5=60 is smallest possible positive product
		

Crossrefs

Programs

  • Mathematica
    maxShortLeg = 66; terms = 71;
    r[a_] := {a, b, c} /. {ToRules[Reduce[a <= b < c && a^2+b^2 == c^2, {b, c}, Integers]]};
    abc = r /@ Complement[Range[maxShortLeg], {1, 2, 4}] // Flatten[#, 1]&;
    SortBy[abc, Times @@ # &][[;; terms, 1]] (* Jean-François Alcover, Nov 21 2019 *)

Formula

a(n) =A057096(n)/(A057099(n)*A057100(n)) =sqrt(A057100(n)^2-A057099(n)^2)

A386309 Short legs of Pythagorean triples that do not have the form (u^2 - v^2, 2*u*v, u^2 + v^2) ordered by increasing hypotenuse (A386307), where u and v are positive integers.

Original entry on oeis.org

9, 15, 18, 21, 15, 30, 24, 33, 36, 39, 25, 42, 45, 21, 30, 51, 40, 60, 35, 57, 60, 48, 63, 66, 36, 69, 56, 72, 27, 35, 78, 50, 81, 84, 55, 100, 87, 90, 42, 93, 60, 84, 99, 65, 102, 80, 120, 105, 49, 70, 33, 111, 60, 88, 114, 117, 99, 75, 48, 120, 140, 96, 123, 45
Offset: 1

Views

Author

Felix Huber, Aug 19 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.

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 12 is a term.
		

Crossrefs

Subsequence of A046083.

Programs

  • Maple
    A386309:=proc(N) # To get all terms with 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,3],i=1..nops(r));
    end proc;
    A386309(1000);

Formula

a(n) = sqrt(A386307(n)^2 - A386308(n)^2).
{A046083(n)} = {a(n)} union {A046086(n)} union {A386945(n)}.

A386945 Short legs of Pythagorean triples of the form (p^2 - q^2, 2*p*q, p^2 + q^2), ordered by increasing hypotenuse (A386943).

Original entry on oeis.org

6, 12, 10, 16, 24, 27, 14, 20, 40, 32, 24, 48, 18, 54, 28, 40, 56, 80, 45, 22, 75, 66, 32, 64, 96, 48, 72, 96, 36, 72, 26, 78, 108, 130, 56, 40, 80, 112, 120, 63, 30, 160, 90, 44, 147, 150, 88, 132, 64, 180, 128, 176, 48, 34, 192, 96, 102, 144, 170, 192, 125, 72
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.

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, 6 is a term.
		

Crossrefs

Programs

  • Maple
    A386945:=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,3],i=1..nops(l));
    end proc;
    A386945(296);

Formula

a(n) = sqrt(A386943(n)^2 - A386944(n)^2).
{A046083(n)} = {a(n)} union {A046086(n)} union {A386309(n)}.
Showing 1-10 of 17 results. Next