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.

User: Rui Lin

Rui Lin's wiki page.

Rui Lin has authored 5 sequences.

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

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).

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

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).

A328708 Number of non-primitive Pythagorean triples with leg n.

Original entry on oeis.org

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

Author

Rui Lin, Oct 26 2019

Keywords

Comments

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

Examples

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

References

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

Crossrefs

Formula

a(n) = A046079(n) - A024361(n).

A309425 Difference x-y of generator pairs (x,y) {x and y coprime and not both odd, x > y} of primitive Pythagorean triangles, sorted by x and y (for same x).

Original entry on oeis.org

1, 1, 3, 1, 3, 1, 5, 1, 5, 3, 1, 7, 5, 3, 1, 7, 5, 1, 9, 7, 3, 1, 9, 7, 5, 3, 1, 11, 7, 5, 1, 11, 9, 7, 5, 3, 1, 13, 11, 9, 5, 3, 1, 13, 11, 7, 1, 15, 13, 11, 9, 7, 5, 3, 1, 15, 13, 11, 9, 7, 5, 3, 1, 17, 13, 11, 7, 5, 1, 17, 15, 13, 11, 9, 7, 5, 3, 1, 19, 17, 13, 11, 9, 7, 3, 1
Offset: 1

Author

Rui Lin, Jul 31 2019

Keywords

Comments

This sequence is based on x and y (for same x) in increasing order, directly mapping to A094192 and A094193, while A126637 is sorted by the sum x+y.
Given any two of the four sequences below, primitive Pythagorean triangles can be generated.
A094192: the bigger one in generator pairs;
A094193: the smaller one in generator pairs;
A309424: the sum of generator pairs;
A309425: the difference of generator pairs.

Crossrefs

Formula

a(n) = A094192(n) - A094193(n).

A309424 Sum x+y of generator pairs (x, y) {x and y coprime and not both odd} of primitive Pythagorean triangles, sorted by x and y (for same x).

Original entry on oeis.org

3, 5, 5, 7, 7, 9, 7, 11, 9, 11, 13, 9, 11, 13, 15, 11, 13, 17, 11, 13, 17, 19, 13, 15, 17, 19, 21, 13, 17, 19, 23, 15, 17, 19, 21, 23, 25, 15, 17, 19, 23, 25, 27, 17, 19, 23, 29, 17, 19, 21, 23, 25, 27, 29, 31, 19, 21, 23, 25, 27, 29, 31, 33, 19, 23, 25, 29, 31, 35, 21, 23, 25, 27, 29, 31, 33, 35, 37, 21, 23, 27, 29, 31, 33, 37, 39
Offset: 1

Author

Rui Lin, Jul 31 2019

Keywords

Comments

This sequence is based on x and y (for same x) in increasing order, directly mapping to A094192 and A094193, while A126611 is sorted by the sum x+y.
Given any 2 of below 4 sequences, primitive Pythagorean triangles can be generated.
A094192: the bigger one in generator pairs;
A094193: the smaller one in generator pairs;
A309424: the sum of generator pairs;
A309425: the difference of generator pairs.

Crossrefs

Formula

a(n) = A094192(n) + A094193(n).