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.

Showing 1-10 of 23 results. Next

A046080 a(n) is the number of integer-sided right triangles with hypotenuse n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Or number of ways n^2 can be written as the sum of two positive squares: a(5) = 1: 3^2 + 4^2 = 5^2; a(25) = 2: 7^2 + 24^2 = 15^2 + 20^2 = 25^2. - Alois P. Heinz, Aug 01 2019

References

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

Crossrefs

First differs from A083025 at n=65.
A088111 gives records; A088959 gives where records occur.
Partial sums: A224921.

Programs

  • Maple
    f:= proc(n) local F,t;
      F:= select(t -> t[1] mod 4 = 1, ifactors(n)[2]);
      1/2*(mul(2*t[2]+1, t=F)-1)
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 18 2016
  • Mathematica
    a[1] = 0; a[n_] := With[{fi = Select[ FactorInteger[n], Mod[#[[1]], 4] == 1 & ][[All, 2]]}, (Times @@ (2*fi+1)-1)/2]; Table[a[n], {n, 1, 99}] (* Jean-François Alcover, Feb 06 2012, after first formula *)
  • PARI
    a(n)={my(m=0,k=n,n2=n*n,k2,l2);
    while(1,k=k-1;k2=k*k;l2=n2-k2;if(l2>k2,break);if(issquare(l2),m++));return(m)} \\ brute force, Stanislav Sykora, Mar 18 2015
    
  • PARI
    {a(n) = if( n<1, 0, sum(k=1, sqrtint(n^2 \ 2), issquare(n^2 - k^2)))}; /* Michael Somos, Mar 29 2015 */
    
  • PARI
    a(n) = {my(f = factor(n/(2^valuation(n, 2)))); (prod(k=1, #f~, if ((f[k,1] % 4) == 1, 2*f[k,2] + 1, 1)) - 1)/2;} \\ Michel Marcus, Mar 08 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A046080(n): return prod((e<<1)+1 for p,e in factorint(n).items() if p&3==1)>>1 # Chai Wah Wu, Sep 06 2022

Formula

Let n = 2^e_2 * product_i p_i^f_i * product_j q_j^g_j where p_i == 1 mod 4, q_j == 3 mod 4; then a(n) = (1/2)*(product_i (2*f_i + 1) - 1). - Beiler, corrected
8*a(n) + 4 = A046109(n) for n > 0. - Ralf Stephan, Mar 14 2004
a(n) = 0 for n in A004144. - Lekraj Beedassy, May 14 2004
a(A084645(k)) = 1. - Ruediger Jehn, Jan 14 2022
a(A084646(k)) = 2. - Ruediger Jehn, Jan 14 2022
a(A084647(k)) = 3. - Jean-Christophe Hervé, Dec 01 2013
a(A084648(k)) = 4. - Jean-Christophe Hervé, Dec 01 2013
a(A084649(k)) = 5. - Jean-Christophe Hervé, Dec 01 2013
a(n) = A063725(n^2) / 2. - Michael Somos, Mar 29 2015
a(n) = Sum_{k=1..n} Sum_{i=1..k} [i^2 + k^2 = n^2], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Dec 10 2021
a(A002144(k)^n) = n. - Ruediger Jehn, Jan 14 2022

A046079 Number of Pythagorean triangles with leg n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 4, 3, 1, 2, 1, 4, 4, 1, 1, 7, 2, 1, 3, 4, 1, 4, 1, 4, 4, 1, 4, 7, 1, 1, 4, 7, 1, 4, 1, 4, 7, 1, 1, 10, 2, 2, 4, 4, 1, 3, 4, 7, 4, 1, 1, 13, 1, 1, 7, 5, 4, 4, 1, 4, 4, 4, 1, 12, 1, 1, 7, 4, 4, 4, 1, 10, 4, 1, 1, 13, 4, 1, 4, 7, 1, 7, 4, 4, 4, 1, 4, 13, 1, 2, 7
Offset: 1

Views

Author

Keywords

Comments

Number of ways in which n can be the leg (other than the hypotenuse) of a primitive or nonprimitive right triangle.
Number of ways that 2/n can be written as a sum of exactly two distinct unit fractions. For every solution to 2/n = 1/x + 1/y, x < y, the Pythagorean triple is (n, y-x, x+y-n). - T. D. Noe, Sep 11 2002
For n>2, the positions of the ones in this sequence correspond to the prime numbers and their doubles, A001751. - Ant King, Jan 29 2011
Let L = length of longest leg, H = hypotenuse. For odd n: L =(n^2-1)/2 and H = L+1. For even n, L = (n^2-4)/4 and H = L+2. - Richard R. Forberg, May 31 2013
Or number of ways n^2 can be written as the difference of two positive squares: a(3) = 1: 3^2 = 5^2-4^2; a(8) = 2: 8^2 = 10^2-6^2 = 17^2-15^2; a(16) = 3: 16^2 = 20^2-12^2 = 34^2-30^2 = 65^2-63^2. - Alois P. Heinz, Aug 06 2019
Number of ways to write 2n as the sum of two positive integers r and s such that r < s and (s - r) | (s * r). - Wesley Ivan Hurt, Apr 21 2020

References

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

Crossrefs

Programs

  • Mathematica
    a[n_] := (DivisorSigma[0, If[OddQ[n], n, n / 2]^2] - 1) / 2; Table[a[i], {i, 100}] (* Amber Hu (hupo001(AT)gmail.com), Jan 23 2008 *)
    a[ n_] := Length @ FindInstance[ n > 0 && y > 0 && z > 0 && n^2 + y^2 == z^2, {y, z}, Integers, 10^9]; (* Michael Somos, Jul 25 2018 *)
  • PARI
    A046079(n) = ((numdiv(if(n%2, n, n/2)^2)-1)/2); \\ Antti Karttunen, Sep 27 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A046079(n): return prod((e+(p&1)<<1)-1 for p,e in factorint(n).items())>>1 # Chai Wah Wu, Sep 06 2022
  • Sage
    def A046079(n) : return (number_of_divisors(n^2 if n%2==1 else n^2/4) - 1) // 2 # Eric M. Schmidt, Jan 26 2013
    

Formula

For odd n, a(n) = A018892(n) - 1.
Let n = (2^a0)*(p1^a1)*...*(pk^ak). Then a(n) = [(2*a0 - 1)*(2*a1 + 1)*(2*a2 + 1)*(2*a3 + 1)*...*(2*ak + 1) - 1]/2. Note that if there is no a0 term, i.e., if n is odd, then the first term is simply omitted. - Temple Keller (temple.keller(AT)gmail.com), Jan 05 2008
For odd n, a(n) = (tau(n^2) - 1) / 2; for even n, a(n) = (tau((n / 2)^2) - 1) / 2. - Amber Hu (hupo001(AT)gmail.com), Jan 23 2008
a(n) = Sum_{i=1..n-1} (1 - ceiling(i*(2*n-i)/(2*n-2*i)) + floor(i*(2*n-i)/(2*n-2*i))). - Wesley Ivan Hurt, Apr 21 2020
Sum_{k=1..n} a(k) ~ (n / Pi^2) * (log(n)^2 + c_1 * log(n) + c_2), where c_1 = 2 * (gamma - 1) + 48*log(A) - 4*log(Pi) - 13*log(2)/3 = 3.512088... (gamma = A001620, log(A) = A225746), and c_2 = 6 * gamma^2 - (6 + log(2)) * gamma + 2 - Pi^2/2 + 19*log(2)^2/18 + log(2)/3 - 6*gamma_1 + 8 * (zeta'(2)/zeta(2))^2 + (4 - 12*gamma + 2*log(2)/3) * zeta'(2)/zeta(2) - 4*zeta''(2)/zeta(2) = -4.457877... (gamma_1 = -A082633). - Amiram Eldar, Nov 08 2024

A055527 Shortest other leg of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

4, 3, 12, 8, 24, 6, 12, 24, 60, 5, 84, 48, 8, 12, 144, 24, 180, 15, 20, 120, 264, 7, 60, 168, 36, 21, 420, 16, 480, 24, 44, 288, 12, 15, 684, 360, 52, 9, 840, 40, 924, 33, 24, 528, 1104, 14, 168, 120, 68, 39, 1404, 72, 48, 33, 76, 840, 1740, 11, 1860, 960, 16, 48, 72
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Comments

From Alex Ratushnyak, Mar 30 2014: (Start)
Least positive k such that n^2 + k^2 is a square.
For odd n, a(n) <= 4*triangular((n-1)/2), because n^2 + (4 * triangular((n-1)/2))^2 = ((n^2+1)/2) ^ 2, which is a perfect square since n is odd.
For n = 4*k+2, a(n) <= 8*triangular(k), because (4k+2)^2 + (4*k*(k+1))^2 = (4*k^2 + 4*k + 2)^2. (End)

Crossrefs

See A082183 for a similar sequence involving triangular numbers.

Programs

  • Mathematica
    Table[k = 1; While[! IntegerQ[Sqrt[n^2 + k^2]], k++]; k, {n, 3, 100}] (* T. D. Noe, Apr 02 2014 *)

Formula

a(n) = sqrt(A055526(n)^2-n^2) = 2*A054436/n.

A055523 Longest other leg of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

4, 3, 12, 8, 24, 15, 40, 24, 60, 35, 84, 48, 112, 63, 144, 80, 180, 99, 220, 120, 264, 143, 312, 168, 364, 195, 420, 224, 480, 255, 544, 288, 612, 323, 684, 360, 760, 399, 840, 440, 924, 483, 1012, 528, 1104, 575, 1200, 624, 1300, 675, 1404, 728, 1512, 783
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Maple
    seq(`if`(n::even, (n/2-1)*(n/2+1), (n-1)*(n+1)/2), n=3..100); # Robert Israel, Dec 16 2014
  • Mathematica
    a[n_Integer/;n>=3]:=(3 (n^2-2)+(-1)^(n+1) (n^2+2))/8 (* Todd Silvestri, Dec 16 2014 *)
  • PARI
    Vec(x^3*(x^3-3*x-4)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Sep 15 2014

Formula

a(n) = 2*A055522(n)/n = sqrt(A055524(n)^2-n^2).
a(2k) = (k-1)*(k+1), a(2k+1) = 2k*(k+1).
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: x^3*(x^3-3*x-4) / ((x-1)^3*(x+1)^3). - Colin Barker, Sep 15 2014
a(n) = (3*(n^2-2)+(-1)^(n+1)*(n^2+2))/8. - Todd Silvestri, Dec 16 2014
E.g.f.: 1 + (3*x^2/8 + 3*x/8 - 3/4)*exp(x) + (-x^2/8 + x/8 - 1/4)*exp(-x). - Robert Israel, Dec 16 2014

A055524 Longest other side of a Pythagorean triangle with n as length of one of the three sides (in fact n is a leg and a(n) the hypotenuse).

Original entry on oeis.org

5, 5, 13, 10, 25, 17, 41, 26, 61, 37, 85, 50, 113, 65, 145, 82, 181, 101, 221, 122, 265, 145, 313, 170, 365, 197, 421, 226, 481, 257, 545, 290, 613, 325, 685, 362, 761, 401, 841, 442, 925, 485, 1013, 530, 1105, 577, 1201, 626, 1301, 677, 1405, 730, 1513, 785
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Mathematica
    A055524[n_] := (3*n^2-(-1)^n*(n^2-2)+6)/8; Array[A055524, 100, 3] (* or *)
    LinearRecurrence[{0, 3, 0, -3, 0, 1}, {5, 5, 13, 10, 25, 17}, 100] (* Paolo Xausa, Feb 29 2024 *)
  • PARI
    Vec(-x^3*(2*x^5+x^4-5*x^3-2*x^2+5*x+5)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Sep 15 2014

Formula

a(n) = sqrt(n^2+A055523(n)^2). a(2k) = k^2+1, a(2k+1) = k^2+(k+1)^2.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: -x^3*(2*x^5+x^4-5*x^3-2*x^2+5*x+5) / ((x-1)^3*(x+1)^3). - Colin Barker, Sep 15 2014
a(n) = (3*n^2+6-(n^2-2)*(-1)^n)/8. - Luce ETIENNE, Jul 11 2015

A073120 Areas of Pythagorean (or right) triangles with integer sides of the form (2mn, m^2 - n^2, m^2 + n^2).

Original entry on oeis.org

6, 24, 30, 60, 84, 96, 120, 180, 210, 240, 330, 336, 384, 480, 486, 504, 546, 630, 720, 840, 924, 960, 990, 1224, 1320, 1344, 1386, 1536, 1560, 1710, 1716, 1920, 1944, 2016, 2184, 2310, 2340, 2430, 2520, 2574, 2730, 2880, 3036, 3360, 3570, 3696, 3750, 3840
Offset: 1

Views

Author

Zak Seidov, Aug 25 2002

Keywords

Comments

Equivalently, integers of the form m*n*(m^2 - n^2) where m,n are positive integers with m > n. - James R. Buddenhagen, Aug 10 2008
The sequence giving the areas of all Pythagorean triangles is A009112 (sometimes called "Pythagorean numbers").
For example, the sequence does not contain 54, the area of the Pythagorean triangle with sides (9,12,15). - Robert Israel, Apr 03 2015
See also Theorem 2 of Mohanty and Mohanty. - T. D. Noe, Sep 24 2013

Examples

			6 = 3*4/2 is the area of the right triangle with sides 3 and 4.
84 = 7*24/2 is the area of the right triangle with sides 7 and 24.
		

Crossrefs

Programs

  • Mathematica
    nn = 16; t = Union[Flatten[Table[m*n*(m^2 - n^2), {m, 2, nn}, {n, m - 1}]]]; Select[t, # < nn*(nn^2 - 1) &]

Formula

a(n) = A057102(n) / 4. - Max Alekseyev, Nov 14 2008

Extensions

Description corrected by James R. Buddenhagen, Aug 10 2008, and by Max Alekseyev, Nov 12 2008
Edited by N. J. A. Sloane, Apr 06 2015

A055525 Shortest other side of a Pythagorean triangle having n as length of one of the three sides.

Original entry on oeis.org

4, 3, 3, 8, 24, 6, 12, 6, 60, 5, 5, 48, 8, 12, 8, 24, 180, 12, 20, 120, 264, 7, 7, 10, 36, 21, 20, 16, 480, 24, 44, 16, 12, 15, 12, 360, 15, 9, 9, 40, 924, 33, 24, 528, 1104, 14, 168, 14, 24, 20, 28, 72, 33, 33, 76, 40, 1740, 11, 11, 960, 16, 48, 16, 88, 2244, 32, 92, 24
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{a, c, k = 1, n2 = n^2}, While[ If[ k > n, !IntegerQ[c = Sqrt[n2 + k^2]], !IntegerQ[c = Sqrt[n2 + k^2]] && !IntegerQ[a = Sqrt[n2 - k^2]]], k++; If[k == n, k++]]; If[ IntegerQ@ c, k, Sqrt[n2 - a^2]]]; (* Robert G. Wilson v, Feb 23 2024 *)

Formula

From Robert G. Wilson v, Feb 23 2024: (Start)
sqrt(2*(n-1)) < a(n) < n^2/2.
If n = k*m, then a(n) <= k*a(m). (End)

A055522 Largest area of a Pythagorean triangle with n as length of one of the three sides (in fact as a leg).

Original entry on oeis.org

6, 6, 30, 24, 84, 60, 180, 120, 330, 210, 546, 336, 840, 504, 1224, 720, 1710, 990, 2310, 1320, 3036, 1716, 3900, 2184, 4914, 2730, 6090, 3360, 7440, 4080, 8976, 4896, 10710, 5814, 12654, 6840, 14820, 7980, 17220, 9240, 19866, 10626, 22770, 12144, 25944
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Maple
    seq(piecewise(n mod 2 = 0,n*(n^2-4)/8,n*(n^2-1)/4),n=3..60); # C. Ronaldo
  • Mathematica
    Table[n*(3*(n^2 - 2) - (n^2 + 2)*(-1)^n)/16, {n, 3, 50}] (* Wesley Ivan Hurt, Apr 27 2017 *)

Formula

a(n) = n*A055523(n)/2.
a(2k) = k*(k+1)*(k-1), a(2k+1) = k*(k+1)*(2k+1).
O.g.f.: 6*x^3*(x+1+x^2)/((1-x)^4*(1+x)^4). a(2k+1)=A055112(k). a(2k)=A007531(k+1). [R. J. Mathar, Aug 06 2008]
a(n) = n*(3*(n^2-2)-(n^2+2)*(-1)^n)/16. - Luce ETIENNE, Jul 17 2015

A055526 Shortest hypotenuse of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

5, 5, 13, 10, 25, 10, 15, 26, 61, 13, 85, 50, 17, 20, 145, 30, 181, 25, 29, 122, 265, 25, 65, 170, 45, 35, 421, 34, 481, 40, 55, 290, 37, 39, 685, 362, 65, 41, 841, 58, 925, 55, 51, 530, 1105, 50, 175, 130, 85, 65, 1405, 90, 73, 65, 95, 842, 1741, 61, 1861, 962, 65
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Comments

Smallest k>n such that the squarefree part of k+n equals the squarefree part of k-n - Benoit Cloitre, May 26 2002

Crossrefs

Programs

  • Mathematica
    core[n_] := core[n] = Times @@ Map[#[[1]]^Mod[#[[2]], 2] &, FactorInteger[n]];
    A055526[n_] := Block[{k = n}, While[core[++k+n] != core[k-n]]; k];
    Array[A055526, 100, 3] (* Paolo Xausa, Feb 29 2024 *)
  • PARI
    for(n=3,105,s=n+1; while(abs(core(s+n)-core(s-n))>0,s++); print1(s,","))

Formula

a(n) = sqrt(n^2+A055527(n)^2).

A054435 Smallest area of a Pythagorean triangle with n as length of one of the three sides.

Original entry on oeis.org

6, 6, 6, 24, 84, 24, 54, 24, 330, 30, 30, 336, 54, 96, 60, 216, 1710, 96, 210, 1320, 3036, 84, 84, 120, 486, 294, 210, 216, 7440, 384, 726, 240, 210, 270, 210, 6840, 270, 180, 180, 840, 19866, 726, 486, 12144, 25944, 336, 4116, 336, 540, 480, 630, 1944, 726
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Showing 1-10 of 23 results. Next