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.

A376208 Numbers k such that 4*k+1 is the hypotenuse of a primitive Pythagorean triangle with an even short leg.

This page as a plain text file.
%I A376208 #38 Oct 18 2024 10:49:39
%S A376208 4,7,9,13,16,18,21,25,27,31,34,36,43,46,49,51,55,57,60,64,66,70,73,76,
%T A376208 81,87,91,93,94,99,100,102,111,112,114,121,123,126,127,133,136,141,
%U A376208 144,148,150,156,157,160,165,169,171,172,175,181,183,186,189,196,198,202
%N A376208 Numbers k such that 4*k+1 is the hypotenuse of a primitive Pythagorean triangle with an even short leg.
%C A376208 This sequence is not A094178 \ A375750, because there are hypotenuses for which both kinds of triangles exist. The smallest example occurs for hypotenuse c = 4*a(5) + 1 = 65. The triangle (16, 63, 65) has an even short leg, but there is also the triangle (33, 56, 65) with an odd short leg. Thus, 16 = (65-1)/4 is a term in this sequence and in A375750.
%C A376208 Sorted distinct values of ({A081985} - 1)/4.
%H A376208 Hugo Pfoertner, <a href="/A376208/b376208.txt">Table of n, a(n) for n = 1..10000</a>
%o A376208 (PARI) is_a376208(n,r=0) = my(c=4*n+1, q=qfbsolve(Qfb(1,0,1), c^2, 3), qd=#q, is=0); for(k=1, qd-1, if(vecmin(abs(q[k]))%2==r && gcd([c,q[k]])==1, is=1; break)); is
%o A376208 (Python) # for an array from the beginning
%o A376208 from math import gcd, isqrt
%o A376208 test_all_k_upto = 202
%o A376208 A376208, limit = set(), test_all_k_upto * 4 + 1
%o A376208 for x in range(2,isqrt(limit)+1):
%o A376208     for y in range(min(((d:=isqrt(2*x**2)-x))-(d%2==x%2), (yy:=isqrt(limit-x**2))-(yy%2==x%2)),0,-2):
%o A376208         if gcd(x, y) == 1: A376208.add((x**2 + y**2 - 1) // 4)
%o A376208 print(A376208:=sorted(A376208)) # _Karl-Heinz Hofmann_, Sep 28 2024
%o A376208 (Python) # for testing high single terms
%o A376208 from math import isqrt, gcd
%o A376208 from sympy import factorint
%o A376208 def A376208_isok(k):
%o A376208     c  = k * 4 + 1
%o A376208     if any([(pf-1) % 4 for pf in factorint(c)]): return False # (Test imported from A008846)
%o A376208     y2 = c - (x2:=(x:=isqrt(c))**2)
%o A376208     while 2*x*(y:=isqrt(y2)) < x2-y2:
%o A376208         if y2 == y**2 and gcd(x, y) == 1: return True
%o A376208         x -= 1
%o A376208         y2 = c - (x2:=x**2) # _Karl-Heinz Hofmann_, Oct 17 2024
%Y A376208 {a(n)} U A375750 = A094178.
%Y A376208 Cf. A004613, A008846, A081985.
%K A376208 nonn
%O A376208 1,1
%A A376208 _Hugo Pfoertner_, Sep 20 2024