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.

A024361 Number of primitive Pythagorean triangles with leg n.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Comments

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.
For n > 1, a(n) = 0 for n == 2 (mod 4) (n in A016825).
From Jianing Song, Apr 23 2019: (Start)
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:
(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;
(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) 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.
a(n) = 0 if n = 1 or n == 2 (mod 4), otherwise a(n) is a power of 2.
The earliest occurrence of 2^k is 2*A002110(k+1) for k > 0. (End)

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[If[n == 1 || Mod[n, 4] == 2, 0, 2^(Length[FactorInteger[n]] - 1)], {n, 100}]
  • PARI
    A024361(n) = if(1==n||(2==(n%4)),0,2^(omega(n)-1)); \\ (after the Mathematica program) - Antti Karttunen, Nov 10 2018

Formula

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
a(n) = A024359(n) + A024360(n). - Ray Chandler, Feb 03 2020

Extensions

Incorrect comment removed by Ant King, Jan 28 2011
More terms from Antti Karttunen, Nov 10 2018