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.

A303610 Circle aliasing numbers with 1/n size steps.

Original entry on oeis.org

10, 1010, 110100, 11010100, 1101100100, 110110100100, 11101010101000, 1110110101001000, 111011010101001000, 11101101101001001000, 1110111010101010001000, 111011101010101010001000, 11110110110101010010010000, 1111011011010101010010010000, 111101110101101010010100010000
Offset: 1

Views

Author

Ben Paul Thurston, May 06 2018

Keywords

Comments

Starting from [-1,0] taking 2*n steps of length 1/n each either up or right, follow the path staying as close to the unit circle as possible. Every step up is considered a 1, every step right is considered a 0.

Examples

			For n=3, we have 110100, meaning if we were to start at [-1, 0] and take 2*n=6 steps of length 1/n = 1/6 which can either be up or to the right, to follow the path of the unit circle the closest we would move up 1, up 1 again, then right, then up again, then right two more times, which we translate to the binary number 110100.
		

Crossrefs

Subsequence of A035928 in binary.

Programs

  • Python
    def closer(pos1, pos2):
        dpos1 = (pos1[0]**2.0+pos1[1]**2.0)**.5
        dpos2 = (pos2[0]**2.0+pos2[1]**2.0)**.5
        if (1.0-dpos1)**2.0 < (1.0-dpos2)**2.0:
            return True
        else:
            return False
    def converts(path):
        return ''.join(path)
    l = []
    for steps in range(1, 20):
        stepsize = 1.0/steps
        pos = [-1.0, 0.0]
        paths = []
        for i in range(0, 2*steps):
            if closer([pos[0]+stepsize, pos[1]], [pos[0], pos[1]+stepsize]):
                pos = [pos[0]+stepsize, pos[1]]
                paths.append(str(0))
            else:
                pos = [pos[0], pos[1]+stepsize]
                paths.append(str(1))
        l.append(int(converts(paths)))
    print(l)