login
Number of primitive Pythagorean triangles with leg n.
12

%I #62 Aug 02 2023 07:15:25

%S 0,0,1,1,1,0,1,1,1,0,1,2,1,0,2,1,1,0,1,2,2,0,1,2,1,0,1,2,1,0,1,1,2,0,

%T 2,2,1,0,2,2,1,0,1,2,2,0,1,2,1,0,2,2,1,0,2,2,2,0,1,4,1,0,2,1,2,0,1,2,

%U 2,0,1,2,1,0,2,2,2,0,1,2,1,0,1,4,2,0,2,2,1,0,2,2,2,0,2,2,1,0,2,2,1,0,1,2,4

%N Number of primitive Pythagorean triangles with leg n.

%C Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives number of times A or B takes value n.

%C For n > 1, a(n) = 0 for n == 2 (mod 4) (n in A016825).

%C From _Jianing Song_, Apr 23 2019: (Start)

%C Note that all the primitive Pythagorean triangles are given by A = min{2*u*v, u^2 - v^2}, B = max{2*u*v, u^2 - v^2}, C = u^2 + v^2, where u, v are coprime positive integers, u > v and u - v is odd. As a result:

%C (a) if n is odd, then a(n) is the number of representations of n to the form n = u^2 - v^2, where u, v are coprime positive integers (note that this guarantees that u - v is odd) and u > v. Let s = u + v, t = u - v, then n = s*t, where s and t are unitary divisors of n and s > t, so the number of representations is A034444(n)/2 if n > 1 and 0 if n = 1;

%C (b) if n is divisible by 4, then a(n) is the number of representations of n to the form n = 2*u*v, where u, v are coprime positive integers (note that this also guarantees that u - v is odd because n/2 is even) and u > v. So u and v must be unitary divisors of n/2, so the number of representations is A034444(n/2)/2. Since n is divisible by 4, A034444(n/2) = A034444(n) so a(n) = A034444(n)/2.

%C (c) if n == 2 (mod 4), then n/2 is odd, so n = 2*u*v implies that u and v are both odd, which is not acceptable, so a(n) = 0.

%C a(n) = 0 if n = 1 or n == 2 (mod 4), otherwise a(n) is a power of 2.

%C The earliest occurrence of 2^k is 2*A002110(k+1) for k > 0. (End)

%H Antti Karttunen, <a href="/A024361/b024361.txt">Table of n, a(n) for n = 1..20000</a>

%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html">Pythagorean Triples and Online Calculators</a>

%H J. S. Myers, R. Schroeppel, S. R. Shannon, N. J. A. Sloane, and P. Zimmermann, <a href="http://arxiv.org/abs/2004.14000">Three Cousins of Recaman's Sequence</a>, arXiv:2004:14000 [math.NT], April 2020.

%H Amitabha Tripathi, <a href="https://www.fq.math.ca/Papers1/46_47-4/Tripathi.pdf">On Pythagorean triples containing a fixed integer</a>, Fibonacci Quart. 46/47 (2008/09), no. 4, 331-340.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PythagoreanTriple.html">Pythagorean Triple</a>

%F a(n) = A034444(n)/2 = 2^(A001221(n)-1) if n != 2 (mod 4) and n > 1, a(n) = 0 otherwise. - _Jianing Song_, Apr 23 2019

%F a(n) = A024359(n) + A024360(n). - _Ray Chandler_, Feb 03 2020

%e a(12) = 2 because 12 appears twice, in (A,B,C) = (5,12,13) and (12,35,37).

%t Table[If[n == 1 || Mod[n, 4] == 2, 0, 2^(Length[FactorInteger[n]] - 1)], {n, 100}]

%o (PARI) A024361(n) = if(1==n||(2==(n%4)),0,2^(omega(n)-1)); \\ (after the Mathematica program) - _Antti Karttunen_, Nov 10 2018

%Y Cf. A024359, A024360, A024362, A024363, A046079, A020883, A020884, A034444.

%K nonn

%O 1,12

%A _David W. Wilson_

%E Incorrect comment removed by _Ant King_, Jan 28 2011

%E More terms from _Antti Karttunen_, Nov 10 2018