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.

A078926 Number of primitive Pythagorean triangles with perimeter 2n.

This page as a plain text file.
%I A078926 #15 Sep 08 2022 08:45:08
%S A078926 0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
%T A078926 1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,
%U A078926 0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0
%N A078926 Number of primitive Pythagorean triangles with perimeter 2n.
%C A078926 A Pythagorean triangle is a right triangle whose edge lengths are all integers; such a triangle is 'primitive' if the lengths are relatively prime.
%C A078926 Equivalently, number of odd unitary divisors d of n such that sqrt(n) < d < sqrt(2n). (A divisor d of n is 'unitary' if gcd(d,n/d) = 1.) Sketch of proof: A primitive Pythagorean triangle has edge lengths (r^2-s^2, 2rs, r^2+s^2), where 1<=s<r, r and s are relatively prime and r+s is odd. This has perimeter 2n iff n=r(r+s). Let d=r+s.
%H A078926 Antti Karttunen, <a href="/A078926/b078926.txt">Table of n, a(n) for n = 1..158730</a>
%e A078926 a(858)=2; the primitive Pythagorean triangles with edge lengths (364, 627, 725) and (195, 748, 773) both have perimeter 2*858 = 1716.
%t A078926 oddpart[n_] := If[OddQ[n], n, oddpart[n/2]]; a[n_] := Length[Select[Divisors[oddpart[n]], n<#^2<2n&&GCD[ #, n/# ]==1&]]
%t A078926 (* Second program: *)
%t A078926 Table[DivisorSum[n/2^IntegerExponent[n, 2], 1 &, n < #^2 < 2 n && CoprimeQ[#, n/#] &], {n, 105}] (* _Michael De Vlieger_, Oct 08 2017 *)
%o A078926 (Magma) UnitaryDivisors :=
%o A078926   func<n| [d:d in Divisors(n)|GCD(d,n div d) eq 1]>;
%o A078926 A078926:=
%o A078926   func<n | #[d:d in UnitaryDivisors(n)| IsOdd(d) and Isqrt(n) lt d and d le Isqrt(2*n-1)] >;
%o A078926 [A078926(n):n in [1..105]];
%o A078926 (PARI) A078926(n) = sumdiv(n,d,(d%2)*(1==gcd(d,n/d))*((d*d)>n)*((d*d)<(2*n))); \\ _Antti Karttunen_, Oct 07 2017
%Y A078926 a(n) = A070109(2n). A078927(n) is smallest s such that a(s)=n. a(n) is nonzero iff n is in A020886.
%K A078926 nonn,easy
%O A078926 1,858
%A A078926 _Dean Hickerson_, Dec 15 2002
%E A078926 Secondary offset added by _Antti Karttunen_, Oct 07 2017