A376208 Numbers k such that 4*k+1 is the hypotenuse of a primitive Pythagorean triangle with an even short leg.
4, 7, 9, 13, 16, 18, 21, 25, 27, 31, 34, 36, 43, 46, 49, 51, 55, 57, 60, 64, 66, 70, 73, 76, 81, 87, 91, 93, 94, 99, 100, 102, 111, 112, 114, 121, 123, 126, 127, 133, 136, 141, 144, 148, 150, 156, 157, 160, 165, 169, 171, 172, 175, 181, 183, 186, 189, 196, 198, 202
Offset: 1
Keywords
Links
- Hugo Pfoertner, Table of n, a(n) for n = 1..10000
Programs
-
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) print(A376208:=sorted(A376208)) # Karl-Heinz Hofmann, Sep 28 2024
-
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
Comments