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.

A328949 Number of non-primitive Pythagorean triples with n as a leg or the hypotenuse.

Original entry on oeis.org

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

Views

Author

Rui Lin, Nov 01 2019

Keywords

Comments

Pythagorean triples including primitive ones and non-primitive ones. For a certain n, it may be a leg or the hypotenuse in either a primitive Pythagorean triple, or a non-primitive Pythagorean triple, or both.
This sequence is the count of n as a leg or the hypotenuse in non-primitive Pythagorean triples.

Examples

			For n=10, 10 is a leg in (10,24,26) and the hypotenuse in (6,8,10), so a(10)=A328708(10)+A328712(10)=1+1=2. And 10 is not a leg or the hypotenuse in any primitive Pythagorean triple, a(10)=A046081(10)-A024363(10)=2-0=2.
		

References

  • A. Beiler, Recreations in the Theory of Numbers. New York: Dover Publications, pp. 116-117, 1966.

Crossrefs

Programs

  • Mathematica
    a[n_] := Count[{x, y} /. Solve[(x^2 + y^2 == n^2 || x^2 - y^2 == n^2) && x > y > 0, {x, y}, Integers], p_ /; GCD @@ p > 1]; Array[a, 100] (* Giovanni Resta, Nov 01 2019 *)

Formula

a(n) = A328708(n) + A328712(n).
a(n) = A046081(n) - A024363(n).