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.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Sep 20 2024

Keywords

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.

Crossrefs

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