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.

Previous Showing 41-50 of 55 results. Next

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

A046110 Number of lattice points on circumference of a circle of radius (2n+1)/2 with center at (1/2,0).

Original entry on oeis.org

2, 2, 6, 2, 2, 2, 6, 6, 6, 2, 2, 2, 10, 2, 6, 2, 2, 6, 6, 6, 6, 2, 6, 2, 2, 6, 6, 6, 2, 2, 6, 2, 18, 2, 2, 2, 6, 10, 2, 2, 2, 2, 18, 6, 6, 6, 2, 6, 6, 2, 6, 2, 6, 2, 6, 6, 6, 6, 6, 6, 2, 6, 14, 2, 2, 2, 2, 6, 6, 2, 2, 6, 18, 2, 6, 2, 6, 6, 6, 6, 2, 2, 6, 2, 10, 2, 6, 10, 2, 2, 6, 6, 18, 6, 2, 2, 6, 18
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A046109.

Formula

a(n) = 4 * A046080(2*n+1) + 2. - Sean A. Irvine, Apr 02 2021

A063468 Number of Pythagorean triples in the range [1..n], i.e., the number of integer solutions to x^2 + y^2 = z^2 with 1 <= x,y,z <= n.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 2, 2, 2, 4, 4, 4, 6, 6, 8, 8, 10, 10, 10, 12, 12, 12, 12, 12, 16, 18, 18, 18, 20, 22, 22, 22, 22, 24, 26, 26, 28, 28, 30, 32, 34, 34, 34, 34, 36, 36, 36, 36, 36, 40, 42, 44, 46, 46, 48, 48, 48, 50, 50, 52, 54, 54, 54, 54, 62, 62, 62, 64, 64, 66, 66, 66, 68, 70
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 27 2001

Keywords

Examples

			For n = 5 the Pythagorean triples are (3, 4, 5) and (4, 3, 5), so a (5) = 2.
For n = 10 the Pythagorean triples are (3, 4, 5), (4, 3, 5), (6, 8, 10) and (8, 6, 10), so a(10) = 4.
For n = 17 the Pythagorean triples are (3, 4, 5), (4, 5, 3), (5, 12, 13), (12, 5, 13), (6, 8, 10), (8, 6, 10), (8, 15, 17), (15, 8, 17), (9, 12, 15) and (12, 9, 15), so a(17) = 10.
		

Crossrefs

a(n) = 2*partial sums of A046080(n).

Programs

  • Magma
    [#[: x in [1..n], y in [1..n]| IsSquare(x^2+y^2) and Floor(Sqrt(x^2+y^2)) le n]:n in [1..74]]; // Marius A. Burtea, Jan 22 2020
  • Mathematica
    nq[n_] := SquaresR[2, n^2]/4 - 1; Accumulate@ Array[nq, 80] (* Giovanni Resta, Jan 23 2020 *)

Extensions

Corrected and extended by Vladeta Jovovic, Jul 28 2001

A108707 Minimum side in Pythagorean triangles with hypotenuse of n.

Original entry on oeis.org

0, 0, 0, 0, 3, 0, 0, 0, 0, 6, 0, 0, 5, 0, 9, 0, 8, 0, 0, 12, 0, 0, 0, 0, 7, 10, 0, 0, 20, 18, 0, 0, 0, 16, 21, 0, 12, 0, 15, 24, 9, 0, 0, 0, 27, 0, 0, 0, 0, 14, 24, 20, 28, 0, 33, 0, 0, 40, 0, 36, 11, 0, 0, 0, 16, 0, 0, 32, 0, 42, 0, 0, 48, 24, 21, 0, 0, 30, 0, 48, 0, 18, 0, 0, 13, 0, 60, 0, 39, 54
Offset: 1

Views

Author

Sébastien Dumortier, Jun 20 2005

Keywords

Examples

			a(5) = 3 as the right triangle with sides (3, 4, 5) has hypotenuse n = 5 smallest side a(5) = 3. This is the smallest side a right triangle with integer sides and hypotenuse 5 can have. - _David A. Corneth_, Apr 10 2021
		

Crossrefs

A046080 gives the number of Pythagorean triangles with hypotenuse n.

Programs

  • Mathematica
    f[n_]:=Block[{k=n-1,m=Sqrt[n/2],a},While[k>m&&!IntegerQ[(a=Sqrt[n^2-k^2])],k--];If[k<=m,0,a]];Table[f[n],{n,90}]
  • PARI
    first(n) = {my(lh = List(), res = vector(n, i, oo)); for(u = 2, sqrtint(n), for(v = 1, u, if (u^2+v^2 > n, break); if ((gcd(u, v) == 1) && (0 != (u-v)%2), for (i = 1, n, if (i*(u^2+v^2) > n, break); listput(lh, i*(u^2+v^2)); res[i*(u^2+v^2)] = vecmin([res[i*(u^2+v^2)], i*(u^2 - v^2), i*2*u*v]))))); for(i = 1, n, if(res[i] == oo, res[i] = 0)); res } \\ David A. Corneth, Apr 10 2021, adapted from A009000

Extensions

Extended by Ray Chandler, Dec 20 2011

A108708 Maximum side length in Pythagorean triangles with hypotenuse n.

Original entry on oeis.org

0, 0, 0, 0, 4, 0, 0, 0, 0, 8, 0, 0, 12, 0, 12, 0, 15, 0, 0, 16, 0, 0, 0, 0, 24, 24, 0, 0, 21, 24, 0, 0, 0, 30, 28, 0, 35, 0, 36, 32, 40, 0, 0, 0, 36, 0, 0, 0, 0, 48, 45, 48, 45, 0, 44, 0, 0, 42, 0, 48, 60, 0, 0, 0, 63, 0, 0, 60, 0, 56, 0, 0, 55, 70, 72, 0, 0, 72, 0, 64, 0, 80, 0, 0, 84, 0, 63, 0
Offset: 1

Views

Author

Sébastien Dumortier, Jun 20 2005

Keywords

Examples

			a(5) is 4 as the maximum side (other than the hypotenuse) a right triangle with integer sides and hypotenuse 5 can have.
		

Crossrefs

A046080 gives the number of Pythagorean triangles with hypotenuse n.

Programs

  • Mathematica
    f[n_] := Block[{k = n - 1, m = Sqrt[n/2]}, While[k > m && !IntegerQ[Sqrt[n^2 - k^2]], k-- ]; If[k <= m, 0, k]]; Table[ f[n], {n, 90}] (* Robert G. Wilson v, Jun 21 2005 *)
  • PARI
    first(n) = {my(lh = List(), res = vector(n)); for(u = 2, sqrtint(n), for(v = 1, u, if (u^2+v^2 > n, break); if ((gcd(u, v) == 1) && (0 != (u-v)%2), for (i = 1, n, if (i*(u^2+v^2) > n, break); listput(lh, i*(u^2+v^2)); res[i*(u^2+v^2)] = max(res[i*(u^2+v^2)], max(i*(u^2 - v^2), i*2*u*v)); ); ); ); ); for(i = 1, n, if(res[i] == oo, res[i] = 0)); res } \\ David A. Corneth, Apr 10 2021, adapted from A009000

Extensions

More terms from Robert G. Wilson v, Jun 21 2005

A256452 Number of integer solutions to n^2 = x^2 + y^2 with x>0, y>=0.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 5, 3, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 1, 1, 1, 1, 5, 3, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 1, 9, 1, 1, 3, 1, 3, 1, 1, 3, 3, 5, 1, 1, 3, 1, 3, 1, 3, 1, 1, 9, 1, 3
Offset: 1

Views

Author

Michael Somos, Mar 29 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(d::odd, (-1)^((d-1)/2), 0), d=numtheory[divisors](n^2)): seq(a(n), n=1..100);  # Ridouane Oudra, Aug 18 2024
  • Mathematica
    a[ n_] := Sum[ Mod[ Length@Divisors[n^2 - k^2], 2], {k, n}];
    a[ n_] := Length @ FindInstance[ n^2 == x^2 + y^2 && x > 0 && y >= 0, {x, y}, Integers, 10^9]; (* Michael Somos, Aug 15 2016 *)
    f[p_, e_] := If[Mod[p, 4] == 1, 2*e + 1, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 12 2020 *)
  • PARI
    {a(n) = sum(k=1, n, issquare(n^2 - k^2))};

Formula

Multiplicative with a(p^e) = 2*e + 1 if p == 1 (mod 4), otherwise a(p^e) = 1.
a(n) = 1 + 2*A046080(n) if n>0.
a(n) = A046109(n)/4 for n > 0. - Hugo Pfoertner, Sep 21 2023
a(n) = A002654(n^2). - Ridouane Oudra, Aug 18 2024

A349538 The number of pseudo-Pythagorean triples (which allow negative or 0 sides) on a 2D lattice that are on or inside a circle of radius n.

Original entry on oeis.org

1, 5, 9, 13, 17, 29, 33, 37, 41, 45, 57, 61, 65, 77, 81, 93, 97, 109, 113, 117, 129, 133, 137, 141, 145, 165, 177, 181, 185, 197, 209, 213, 217, 221, 233, 245, 249, 261, 265, 277, 289, 301, 305, 309, 313, 325, 329, 333, 337, 341, 361, 373, 385, 397, 401, 413, 417, 421, 433, 437, 449
Offset: 0

Views

Author

Alexander Kritov, Nov 21 2021

Keywords

Comments

Consider a 2D lattice, where the Cartesian coordinates x and y are legs of the Pythagorean triangle. Thus the notion of Pythagorean triple is extended to the cases when sides x, y are in Z (i.e., sides also include negative integers and zero). The sequence gives the number of such triples on or inside a circle of radius n.
Partial sums of A046109.

Examples

			Sides (coordinates)                                                       a(n)
------------------------------------------------------------------------------
(0,0)                                                                       1
(-1,0)(0,-1)(0,1)(1,0)                                                      5
(-2,0)(0,-2)(0,2)(2,0)                                                      9
(-3,0)(0,-3)(0,3)(3,0)                                                     13
(-4,0)(0,-4)(0,4)(4,0)                                                     17
(-5,0)(-4,-3)(-4,3)(-3,-4)(-3,4)(0,-5)(0,5)(3,-4)(3,4)(4,-3)(4,3)(5,0)     29
(-6,0)(0,-6)(0,6)(6,0)                                                     33
(-7,0)(0,-7)(0,7)(7,0)                                                     37
(-8,0)(0,-8)(0,8)(8,0)                                                     41
(-9,0)(0,-9)(0,9)(9,0)                                                     45
(-10,0)(-8,-6)(-8,6)(-6,-8)(-6,8)(0,-10)(0,10)(6,-8)(6,8)(8,-6)(8,6)(10,0) 57
(-11,0)(0,-11)(0,11)(11,0)                                                 61
(-12,0)(0,-12)(0,12)(12,0)                                                 65
		

Crossrefs

Cf. A046080, A211432, A046109 (first differences), A349536 (in 1/8 sector).

Programs

  • C
    /* See links */
    
  • PARI
    f(n) = if(n==0, return(1)); my(f=factor(n)); 4*prod(i=1, #f~, if(f[i, 1]%4==1, 2*f[i, 2]+1, 1)); \\ A046109
    a(n) = sum(k=0, n, f(k)); \\ Michel Marcus, Nov 27 2021

Formula

a(n) = (A211432(n) + 1)/2.
a(n) = a(n-1) + 4 + 8*A046080(n).

A056138 Number of ways in which n can be the shorter leg (shortest side) of an integer-sided right triangle.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 3, 3, 1, 1, 4, 2, 1, 3, 3, 1, 3, 1, 3, 4, 1, 3, 5, 1, 1, 4, 5, 1, 3, 1, 3, 5, 1, 1, 7, 2, 2, 4, 3, 1, 3, 3, 5, 4, 1, 1, 9, 1, 1, 5, 4, 4, 4, 1, 3, 4, 3, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Crossrefs

Programs

  • PARI
    a(n)=my(b);sum(c=n+2,n^2\2+1,issquare(c^2-n^2,&b) && nCharles R Greathouse IV, Jul 07 2013

Formula

a(n) = A046079(n) - A056137(n) = A046081(n) - A046080(n) - A056137(n).

A063669 Hypotenuses of reciprocal Pythagorean triangles: number of solutions to 1/(12n)^2 = 1/b^2 + 1/c^2 [with b >= c > 0]; also number of values of A020885 (with repetitions) which divide n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 2, 1, 4, 1, 1, 1, 1, 4, 1, 1, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 2, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 1, 1, 1, 6, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 3, 2, 1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 1, 1, 5
Offset: 1

Views

Author

Henry Bottomley, Jul 28 2001

Keywords

Comments

Primitive reciprocal Pythagorean triangles 1/a^2 = 1/b^2 + 1/c^2 have a=fg, b=ef, c=eg where e^2 = f^2 + g^2; i.e., e,f,g represent the sides of primitive Pythagorean triangles. But the product of the two legs of primitive Pythagorean triangles are multiples of 12 and so the reciprocal of hypotenuses of reciprocal Pythagorean triangles are always multiples of 12 (A008594).

Examples

			a(1)=1 since 1/(12*1)^2 = 1/12^2 = 1/15^2 + 1/20^2;
a(70)=6 since 1/(12*70)^2 = 1/840^2 = 1/875^2 + 1/3000^2 = 1/888^2 + 1/2590^2 = 1/910^2 + 1/2184^2 = 1/952^2 + 1/1785^2 = 1/1050^2 + 1/1400^2 = 1/1160^2 + 1/1218^2.
Looking at A020885, 1 is divisible by 1, while 70 is divisible by 1, 5, 10, 14, 35 and again 35.
		

Crossrefs

A342154 Number of partitions of n^5 into two positive squares.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 3, 0, 0, 3, 0, 0, 0, 3, 1, 0, 3, 0, 0, 0, 0, 5, 3, 0, 0, 3, 0, 0, 1, 0, 3, 0, 0, 3, 0, 0, 3, 3, 0, 0, 0, 3, 0, 0, 0, 0, 6, 0, 3, 3, 0, 0, 0, 0, 3, 0, 0, 3, 0, 0, 0, 18, 0, 0, 3, 0, 0, 0, 1, 3, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 18, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 3, 1, 0, 5, 3, 0, 0, 3, 0
Offset: 0

Views

Author

Seiichi Manyama, Mar 02 2021

Keywords

Comments

a(n) > 0 if and only if n is in A000404. - Robert Israel, Mar 03 2021

Examples

			2^5 = 32 = 4^2 + 4^2. So a(2) = 1.
5^5 = 3125 = 10^2 + 55^2 = 25^2 + 50^2 = 38^2 + 41^2. So a(5) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x,y,S;
          S:= map(t -> subs(t,[x,y]),[isolve(x^2+y^2=n^5)]);
          nops(select(t -> t[1] >= t[2] and t[2] > 0, S))
    end proc:
    map(f, [$0..200]); # Robert Israel, Mar 03 2021
  • PARI
    a(n) = my(cnt=0, m=n^5); for(k=1, sqrt(m/2), l=m-k*k; if(l>0&&issquare(l), cnt++)); cnt;

Formula

a(n) = A025426(A000584(n)).
Previous Showing 41-50 of 55 results. Next