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.

A325602 Lower left-hand x-coordinate for 2 X 2 invisible forest with 0 < x < y.

Original entry on oeis.org

14, 14, 20, 44, 39, 21, 45, 34, 50, 21, 44, 39, 54, 75, 45, 65, 34, 77, 74, 69, 90, 56, 50, 84, 76, 33, 84, 14, 20, 69, 55, 111, 75, 33, 14, 105, 35, 119, 95, 20, 56, 35, 74, 90, 110, 104, 76, 62, 20, 35
Offset: 1

Views

Author

Benjamin Hutz, May 10 2019

Keywords

Comments

These are 2 X 2 rectangles of lattice points not visible along straight lines of sight from the origin. The sequence is ordered by Euclidean distance from (0,0).

Examples

			(14,20), (14,35), (20,35), (44,54), (39,65), (21,77), (45,69), (34,84), ...
		

Crossrefs

Programs

  • Python
    def is_nxn(x,y,n):
        if all([gcd(x+a,y+b) != 1 for a in range(n) for b in range(n)]):
            return True
        return False
    def insert_item(pts, item, index):
        N = len(pts)
        if N == 0:
          return [item]
        elif N == 1:
            if item[index] < pts[0][index]:
                pts.insert(0,item)
            else:
                pts.append(item)
            return pts
        else: #binary insertion
            left = 1
            right = N
            mid = ((left + right)/2).floor()
            if item[index] < pts[mid][index]:
            # item goes into first half
                return insert_item(pts[:mid], item, index) + pts[mid:N]
            else:
            # item goes into second half
                return pts[:mid] + insert_item(pts[mid:N], item, index)
    B=1200
    L=[]
    for x in range(1,B):
        for y in range(x+1,B):
            if is_nxn(x,y,n=2):
                G=[x,y,x^2+y^2]
                L=insert_item(L, G, 2)