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.

A379830 a(n) is the number of Pythagorean triples (u, v, w) for which w - u = n where u < v < w.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 2, 2, 1, 0, 1, 0, 1, 0, 2, 0, 4, 0, 1, 0, 1, 0, 2, 3, 1, 2, 1, 0, 1, 0, 5, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 1, 2, 1, 0, 2, 4, 7, 0, 1, 0, 4, 0, 2, 0, 1, 0, 1, 0, 1, 2, 5, 0, 1, 0, 1, 0, 1, 0, 8, 0, 1, 3, 1, 0, 1, 0, 2, 6, 1, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Felix Huber, Jan 07 2025

Keywords

Comments

The difference between the hypotenuse and the short leg of a primitive Pythagorean triple (p^2 - q^2, 2*p*q, p^2 + q^2) (where p > q are coprimes and not both odd) is d = max(2*q^2, (p - q)^2). For every of these primitive Pythagorean triples whose d divides n, there is a Pythagorean triple with w - u = n. Therefore d <= n and it follows that 1 <= q <= sqrt(n/2) and q + 1 <= p <= q + sqrt(n), which means that there is a finite number of Pythagorean triples with w - u = n.

Examples

			The a(18) = 4 Pythagorean triples are (27, 36, 45), (16, 30, 34), (40, 42, 58), (7, 24, 25) because 45 - 27 = 34 - 16 = 58 - 40 = 25 - 7 = 18.
See also linked Maple program "Pythagorean triples for which w - u = n".
		

Crossrefs

Programs

  • Maple
    A379830:=proc(n)
        local a,p,q;
        a:=0;
        for q to isqrt(floor(n/2)) do
            for p from q+1 to q+isqrt(n) do
                if igcd(p,q)=1 and (is(p,even) or is(q,even)) and n mod max((p-q)^2,2*q^2)=0 then
                    a:=a+1
                fi
            od
        od;
        return a
    end proc;
    seq(A379830(n),n=0..87);