A046079 Number of Pythagorean triangles with leg n.
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
References
- Albert H. Beiler, Recreations in the Theory of Numbers. New York: Dover Publications, 1966, pp. 116-117.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Hanz Becker, Pythagorean triples in JavaScript.
- Ron Knott, Pythagorean Triples and Online Calculators.
- Project Euler, Problem 176: Right-angled triangles that share a cathetus.
- Fred Richman, Pythagorean Triples. [Wayback Machine link]
- Amitabha Tripathi, On Pythagorean triples containing a fixed integer, Fib. Q., 46/47 (2008/2009), 331-340. See Theorem 6.
- Eric Weisstein's World of Mathematics, Pythagorean Triple.
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
Comments