login
A303610
Circle aliasing numbers with 1/n size steps.
0
10, 1010, 110100, 11010100, 1101100100, 110110100100, 11101010101000, 1110110101001000, 111011010101001000, 11101101101001001000, 1110111010101010001000, 111011101010101010001000, 11110110110101010010010000, 1111011011010101010010010000, 111101110101101010010100010000
OFFSET
1,1
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.
EXAMPLE
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.
PROG
(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)
CROSSREFS
Subsequence of A035928 in binary.
Sequence in context: A163662 A176067 A080070 * A080120 A300571 A274069
KEYWORD
nonn
AUTHOR
Ben Paul Thurston, May 06 2018
STATUS
approved