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.

A328712 Number of non-primitive Pythagorean triples with hypotenuse n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1
Offset: 1

Views

Author

Rui Lin, Oct 26 2019

Keywords

Comments

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

Examples

			n=5 as hypotenuse in only one primitive Pythagorean triple, (3,4,5); so a(5)=0.
n=10 as hypotenuse in only one non-primitive Pythagorean triple, (6,8,10); so a(10)=1.
n=25 as hypotenuse in one primitive Pythagorean triple (7,24,25) and in one non-primitive Pythagorean triple (15,20,25); so a(25)=1.
		

References

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

Crossrefs

Programs

  • Maple
    f:= proc(n) local R;
    if isprime(n) then return 0 fi;
      R:= map(t -> subs(t,[x,y]),[isolve(x^2+y^2=n^2)]);
      nops(select(t -> t[1]>=1 and t[2]>=t[1] and igcd(t[1],t[2])>1, R))
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 31 2019
  • Mathematica
    a[n_] := Module[{R, x, y}, If[PrimeQ[n], 0, R = Solve[GCD[x, y] > 1 && x >= 1 && y >= x && x^2 + y^2 == n^2, {x, y}, Integers]; Length[R]]];
    Array[a, 102] (* Jean-François Alcover, Jun 20 2020, after Maple *)

Formula

a(n) = A046080(n) - A024362(n).