OFFSET
1,1
COMMENTS
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.
Sorted distinct values of ({A081985} - 1)/4.
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 1..10000
PROG
(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
(Python) # for an array from the beginning
from math import gcd, isqrt
test_all_k_upto = 202
A376208, limit = set(), test_all_k_upto * 4 + 1
for x in range(2, isqrt(limit)+1):
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):
if gcd(x, y) == 1: A376208.add((x**2 + y**2 - 1) // 4)
(Python) # for testing high single terms
from math import isqrt, gcd
from sympy import factorint
def A376208_isok(k):
c = k * 4 + 1
if any([(pf-1) % 4 for pf in factorint(c)]): return False # (Test imported from A008846)
y2 = c - (x2:=(x:=isqrt(c))**2)
while 2*x*(y:=isqrt(y2)) < x2-y2:
if y2 == y**2 and gcd(x, y) == 1: return True
x -= 1
y2 = c - (x2:=x**2) # Karl-Heinz Hofmann, Oct 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Sep 20 2024
STATUS
approved