hailstone_2011_09_07

3745 days ago by calkin_360

range(10) 
       
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
       
 
       
 
       
len(range(10)) 
       
10
10
 
       
my_list=[1,2,4,5] 
       
 
       
len(my_list) 
       
4
4
 
       
for i in my_list: print i^2+i+1 
       
3
7
21
31
3
7
21
31
my_list[3] 
       
5
5
my_list[3]=7 
       
my_list 
       
[1, 2, 4, 7]
[1, 2, 4, 7]
my_list.append(17) 
       
my_list 
       
[1, 2, 4, 7, 17]
[1, 2, 4, 7, 17]
my_list.extend(range(10)) 
       
my_list 
       
[1, 2, 4, 7, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 4, 7, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
hailstone= [-1 for i in range(1001) ] 
       
hailstone 
       
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
 
       

Set at distaonce 0 = {1}

Set at distance 1 = {2}

Set at distance 2 = {4}

 

set_at_distance=[] 
       
set_at_distance.append([1]) 
       
set_at_distance 
       
[[1]]
[[1]]
set_at_distance.append([2]) 
       
set_at_distance.append([4]) 
       
set_at_distance[2] 
       
[4]
[4]
def g(n): if mod(n,6)==4: return [(n-1)/3,2*n] else: return [2*n] 
       
g(4) 
       
[1, 8]
[1, 8]
g(8) 
       
[16]
[16]
g(16) 
       
[5, 32]
[5, 32]
set_at_distance=[ [1], [2], [4], [8]] 
       
set_at_distance.extend([-1] for i in range(20)) 
       
set_at_distance 
       
[[1], [2], [4], [8], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1],
[-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1]]
[[1], [2], [4], [8], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1]]
hailstone[1]=0 hailstone[2]=1 hailstone[4]=2 hailstone[8]=3 for k in range(3,20): new_list=[] for i in set_at_distance[k]: new_list.extend(g(i)) set_at_distance[k+1]=new_list for i in new_list: if i<=1000: hailstone[i]=k+1 
       
set_at_distance 
       
[[1], [2], [4], [8], [16], [5, 32], [10, 64], [3, 20, 21, 128], [6, 40,
42, 256], [12, 13, 80, 84, 85, 512], [24, 26, 160, 168, 170, 1024], [48,
52, 53, 320, 336, 340, 341, 2048], [96, 17, 104, 106, 640, 672, 113,
680, 682, 4096], [192, 34, 208, 35, 212, 213, 1280, 1344, 226, 1360,
227, 1364, 1365, 8192], [384, 11, 68, 69, 416, 70, 424, 426, 2560, 2688,
75, 452, 453, 2720, 454, 2728, 2730, 16384], [768, 22, 136, 138, 832,
23, 140, 141, 848, 852, 853, 5120, 5376, 150, 904, 906, 5440, 151, 908,
909, 5456, 5460, 5461, 32768], [1536, 7, 44, 45, 272, 276, 277, 1664,
46, 280, 282, 1696, 1704, 1706, 10240, 10752, 300, 301, 1808, 1812,
1813, 10880, 302, 1816, 1818, 10912, 10920, 10922, 65536], [3072, 14,
88, 90, 544, 552, 554, 3328, 15, 92, 93, 560, 564, 565, 3392, 3408,
3412, 3413, 20480, 21504, 600, 602, 3616, 3624, 3626, 21760, 604, 605,
3632, 3636, 3637, 21824, 21840, 21844, 21845, 131072], [6144, 28, 29,
176, 180, 181, 1088, 1104, 1108, 1109, 6656, 30, 184, 186, 1120, 1128,
1130, 6784, 6816, 1137, 6824, 6826, 40960, 43008, 1200, 1204, 1205,
7232, 7248, 7252, 7253, 43520, 201, 1208, 1210, 7264, 7272, 7274, 43648,
43680, 7281, 43688, 43690, 262144], [12288, 9, 56, 58, 352, 360, 362,
2176, 2208, 369, 2216, 2218, 13312, 60, 61, 368, 372, 373, 2240, 2256,
2260, 2261, 13568, 13632, 2274, 13648, 2275, 13652, 13653, 81920, 86016,
2400, 401, 2408, 2410, 14464, 14496, 2417, 14504, 14506, 87040, 402,
2416, 403, 2420, 2421, 14528, 14544, 14548, 14549, 87296, 87360, 14562,
87376, 14563, 87380, 87381, 524288], [24576, 18, 112, 19, 116, 117, 704,
720, 724, 725, 4352, 4416, 738, 4432, 739, 4436, 4437, 26624, 120, 122,
736, 744, 746, 4480, 4512, 753, 4520, 4522, 27136, 27264, 4548, 4549,
27296, 4550, 27304, 27306, 163840, 172032, 4800, 802, 4816, 803, 4820,
4821, 28928, 28992, 4834, 29008, 4835, 29012, 29013, 174080, 804, 805,
4832, 806, 4840, 4842, 29056, 29088, 4849, 29096, 29098, 174592, 174720,
29124, 29125, 174752, 29126, 174760, 174762, 1048576], [-1], [-1], [-1]]
[[1], [2], [4], [8], [16], [5, 32], [10, 64], [3, 20, 21, 128], [6, 40, 42, 256], [12, 13, 80, 84, 85, 512], [24, 26, 160, 168, 170, 1024], [48, 52, 53, 320, 336, 340, 341, 2048], [96, 17, 104, 106, 640, 672, 113, 680, 682, 4096], [192, 34, 208, 35, 212, 213, 1280, 1344, 226, 1360, 227, 1364, 1365, 8192], [384, 11, 68, 69, 416, 70, 424, 426, 2560, 2688, 75, 452, 453, 2720, 454, 2728, 2730, 16384], [768, 22, 136, 138, 832, 23, 140, 141, 848, 852, 853, 5120, 5376, 150, 904, 906, 5440, 151, 908, 909, 5456, 5460, 5461, 32768], [1536, 7, 44, 45, 272, 276, 277, 1664, 46, 280, 282, 1696, 1704, 1706, 10240, 10752, 300, 301, 1808, 1812, 1813, 10880, 302, 1816, 1818, 10912, 10920, 10922, 65536], [3072, 14, 88, 90, 544, 552, 554, 3328, 15, 92, 93, 560, 564, 565, 3392, 3408, 3412, 3413, 20480, 21504, 600, 602, 3616, 3624, 3626, 21760, 604, 605, 3632, 3636, 3637, 21824, 21840, 21844, 21845, 131072], [6144, 28, 29, 176, 180, 181, 1088, 1104, 1108, 1109, 6656, 30, 184, 186, 1120, 1128, 1130, 6784, 6816, 1137, 6824, 6826, 40960, 43008, 1200, 1204, 1205, 7232, 7248, 7252, 7253, 43520, 201, 1208, 1210, 7264, 7272, 7274, 43648, 43680, 7281, 43688, 43690, 262144], [12288, 9, 56, 58, 352, 360, 362, 2176, 2208, 369, 2216, 2218, 13312, 60, 61, 368, 372, 373, 2240, 2256, 2260, 2261, 13568, 13632, 2274, 13648, 2275, 13652, 13653, 81920, 86016, 2400, 401, 2408, 2410, 14464, 14496, 2417, 14504, 14506, 87040, 402, 2416, 403, 2420, 2421, 14528, 14544, 14548, 14549, 87296, 87360, 14562, 87376, 14563, 87380, 87381, 524288], [24576, 18, 112, 19, 116, 117, 704, 720, 724, 725, 4352, 4416, 738, 4432, 739, 4436, 4437, 26624, 120, 122, 736, 744, 746, 4480, 4512, 753, 4520, 4522, 27136, 27264, 4548, 4549, 27296, 4550, 27304, 27306, 163840, 172032, 4800, 802, 4816, 803, 4820, 4821, 28928, 28992, 4834, 29008, 4835, 29012, 29013, 174080, 804, 805, 4832, 806, 4840, 4842, 29056, 29088, 4849, 29096, 29098, 174592, 174720, 29124, 29125, 174752, 29126, 174760, 174762, 1048576], [-1], [-1], [-1]]
number_at_distance=map(len,set_at_distance) number_at_distance 
       
[1, 1, 1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 10, 14, 18, 24, 29, 36, 44, 58, 72,
1, 1, 1]
[1, 1, 1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 10, 14, 18, 24, 29, 36, 44, 58, 72, 1, 1, 1]
hailstone 
       
[-1, 0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7,
7, 15, 15, 10, -1, 10, -1, 18, 18, 18, -1, 5, -1, 13, 13, -1, -1, -1,
-1, 8, -1, 8, -1, 16, 16, 16, -1, 11, -1, -1, -1, 11, 11, -1, -1, 19,
-1, 19, -1, 19, 19, -1, -1, 6, -1, -1, -1, 14, 14, 14, -1, -1, -1, -1,
14, -1, -1, -1, -1, 9, -1, -1, -1, 9, 9, -1, -1, 17, -1, 17, -1, 17, 17,
-1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 12, -1, 12, -1, -1, -1, -1, -1,
20, 12, -1, -1, 20, 20, -1, -1, 20, -1, 20, -1, -1, -1, -1, -1, 7, -1,
-1, -1, -1, -1, -1, -1, 15, -1, 15, -1, 15, 15, -1, -1, -1, -1, -1, -1,
-1, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1,
-1, -1, 10, -1, 10, -1, -1, -1, -1, -1, 18, -1, -1, -1, 18, 18, -1, -1,
18, -1, 18, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, 18,
-1, -1, -1, -1, -1, -1, 13, -1, -1, -1, 13, 13, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1,
-1, -1, 16, 16, -1, -1, 16, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, 11, 11, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, 19, -1, 19, -1,
-1, -1, -1, -1, 19, 19, -1, -1, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 19, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1,
-1, -1, -1, -1, -1, -1, 14, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 14,
14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
17, -1, -1, -1, -1, -1, -1, -1, 17, -1, 17, -1, -1, -1, -1, -1, 17, -1,
-1, -1, 17, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 17, -1, 17, -1, 17, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 12, -1, 12, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1,
20, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, 20, 20, -1, -1,
-1, -1, 20, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 20, 20, 20, 20, 20, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1,
-1, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
15, -1, 15, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1]
[-1, 0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7, 7, 15, 15, 10, -1, 10, -1, 18, 18, 18, -1, 5, -1, 13, 13, -1, -1, -1, -1, 8, -1, 8, -1, 16, 16, 16, -1, 11, -1, -1, -1, 11, 11, -1, -1, 19, -1, 19, -1, 19, 19, -1, -1, 6, -1, -1, -1, 14, 14, 14, -1, -1, -1, -1, 14, -1, -1, -1, -1, 9, -1, -1, -1, 9, 9, -1, -1, 17, -1, 17, -1, 17, 17, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 12, -1, 12, -1, -1, -1, -1, -1, 20, 12, -1, -1, 20, 20, -1, -1, 20, -1, 20, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, 15, -1, 15, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, 10, -1, 10, -1, -1, -1, -1, -1, 18, -1, -1, -1, 18, 18, -1, -1, 18, -1, 18, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1, 16, 16, -1, -1, 16, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, 11, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, 19, -1, 19, -1, -1, -1, -1, -1, 19, 19, -1, -1, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, 14, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 14, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, 17, -1, 17, -1, -1, -1, -1, -1, 17, -1, -1, -1, 17, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, 17, -1, 17, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 12, -1, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, 20, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, 20, 20, -1, -1, -1, -1, 20, -1, 20, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 20, 20, 20, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, 15, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
def f(n): if mod(n,2)==0: return n/2 else: return 3*n+1 
       
f(4) 
       
2
2
step_counter=0 n=27 while n>1: print n, n=f(n) step_counter=step_counter+1 
       
27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91
274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593
1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276
638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822
911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433
1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20
10 5 16 8 4 2
27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2
step_counter 
       
111
111
for i in range(len(hailstone)): if hailstone[i]==-1: n=i step_counter=0 while n>1: n=f(n) step_counter=step_counter + 1 hailstone[i]=step_counter 
       
hailstone 
       
[0, 0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7,
7, 15, 15, 10, 23, 10, 111, 18, 18, 18, 106, 5, 26, 13, 13, 21, 21, 21,
34, 8, 109, 8, 29, 16, 16, 16, 104, 11, 24, 24, 24, 11, 11, 112, 112,
19, 32, 19, 32, 19, 19, 107, 107, 6, 27, 27, 27, 14, 14, 14, 102, 22,
115, 22, 14, 22, 22, 35, 35, 9, 22, 110, 110, 9, 9, 30, 30, 17, 30, 17,
92, 17, 17, 105, 105, 12, 118, 25, 25, 25, 25, 25, 87, 12, 38, 12, 100,
113, 113, 113, 69, 20, 12, 33, 33, 20, 20, 33, 33, 20, 95, 20, 46, 108,
108, 108, 46, 7, 121, 28, 28, 28, 28, 28, 41, 15, 90, 15, 41, 15, 15,
103, 103, 23, 116, 116, 116, 23, 23, 15, 15, 23, 36, 23, 85, 36, 36, 36,
54, 10, 98, 23, 23, 111, 111, 111, 67, 10, 49, 10, 124, 31, 31, 31, 80,
18, 31, 31, 31, 18, 18, 93, 93, 18, 44, 18, 44, 106, 106, 106, 44, 13,
119, 119, 119, 26, 26, 26, 119, 26, 18, 26, 39, 26, 26, 88, 88, 13, 39,
39, 39, 13, 13, 101, 101, 114, 26, 114, 52, 114, 114, 70, 70, 21, 52,
13, 13, 34, 34, 34, 127, 21, 83, 21, 127, 34, 34, 34, 52, 21, 21, 96,
96, 21, 21, 47, 47, 109, 47, 109, 65, 109, 109, 47, 47, 8, 122, 122,
122, 29, 29, 29, 78, 29, 122, 29, 21, 29, 29, 42, 42, 16, 29, 91, 91,
16, 16, 42, 42, 16, 42, 16, 60, 104, 104, 104, 42, 24, 29, 117, 117,
117, 117, 117, 55, 24, 73, 24, 117, 16, 16, 16, 42, 24, 37, 37, 37, 24,
24, 86, 86, 37, 130, 37, 37, 37, 37, 55, 55, 11, 24, 99, 99, 24, 24, 24,
143, 112, 50, 112, 24, 112, 112, 68, 68, 11, 112, 50, 50, 11, 11, 125,
125, 32, 125, 32, 125, 32, 32, 81, 81, 19, 125, 32, 32, 32, 32, 32, 50,
19, 45, 19, 45, 94, 94, 94, 45, 19, 19, 45, 45, 19, 19, 45, 45, 107, 63,
107, 58, 107, 107, 45, 45, 14, 32, 120, 120, 120, 120, 120, 120, 27, 58,
27, 76, 27, 27, 120, 120, 27, 19, 19, 19, 27, 27, 40, 40, 27, 40, 27,
133, 89, 89, 89, 133, 14, 133, 40, 40, 40, 40, 40, 32, 14, 58, 14, 53,
102, 102, 102, 40, 115, 27, 27, 27, 115, 115, 53, 53, 115, 27, 115, 53,
71, 71, 71, 97, 22, 115, 53, 53, 14, 14, 14, 40, 35, 128, 35, 128, 35,
35, 128, 128, 22, 35, 84, 84, 22, 22, 128, 128, 35, 35, 35, 27, 35, 35,
53, 53, 22, 48, 22, 22, 97, 97, 97, 141, 22, 48, 22, 141, 48, 48, 48,
97, 110, 22, 48, 48, 110, 110, 66, 66, 110, 61, 110, 35, 48, 48, 48, 61,
9, 35, 123, 123, 123, 123, 123, 61, 30, 123, 30, 123, 30, 30, 79, 79,
30, 30, 123, 123, 30, 30, 22, 22, 30, 22, 30, 48, 43, 43, 43, 136, 17,
43, 30, 30, 92, 92, 92, 43, 17, 136, 17, 30, 43, 43, 43, 87, 17, 43, 43,
43, 17, 17, 61, 61, 105, 56, 105, 30, 105, 105, 43, 43, 25, 30, 30, 30,
118, 118, 118, 30, 118, 56, 118, 118, 118, 118, 56, 56, 25, 74, 74, 74,
25, 25, 118, 118, 17, 56, 17, 69, 17, 17, 43, 43, 25, 131, 38, 38, 38,
38, 38, 69, 25, 131, 25, 131, 87, 87, 87, 131, 38, 25, 131, 131, 38, 38,
38, 38, 38, 30, 38, 30, 56, 56, 56, 131, 12, 51, 25, 25, 100, 100, 100,
38, 25, 144, 25, 100, 25, 25, 144, 144, 113, 51, 51, 51, 113, 113, 25,
25, 113, 51, 113, 144, 69, 69, 69, 95, 12, 64, 113, 113, 51, 51, 51, 64,
12, 64, 12, 38, 126, 126, 126, 38, 33, 126, 126, 126, 33, 33, 126, 126,
33, 126, 33, 64, 82, 82, 82, 170, 20, 33, 126, 126, 33, 33, 33, 64, 33,
25, 33, 25, 33, 33, 51, 51, 20, 46, 46, 46, 20, 20, 46, 46, 95, 33, 95,
139, 95, 95, 46, 46, 20, 139, 20, 20, 46, 46, 46, 95, 20, 90, 20, 46,
46, 46, 46, 139, 108, 20, 64, 64, 108, 108, 59, 59, 108, 33, 108, 152,
46, 46, 46, 59, 15, 33, 33, 33, 121, 121, 121, 152, 121, 33, 121, 59,
121, 121, 121, 121, 28, 121, 59, 59, 28, 28, 77, 77, 28, 77, 28, 103,
121, 121, 121, 72, 28, 59, 20, 20, 20, 20, 20, 72, 28, 46, 28, 134, 41,
41, 41, 134, 28, 41, 41, 41, 28, 28, 134, 134, 90, 134, 90, 41, 90, 90,
134, 134, 15, 28, 134, 134, 41, 41, 41, 85, 41, 41, 41, 41, 41, 41, 33,
33, 15, 59, 59, 59, 15, 15, 54, 54, 103, 28, 103, 147, 103, 103, 41, 41,
116, 147, 28, 28, 28, 28, 28, 178, 116, 147, 116, 28, 54, 54, 54, 147,
116, 116, 28, 28, 116, 116, 54, 54, 72, 147, 72, 46, 72, 72, 98, 98, 23,
67, 116, 116, 54, 54, 54, 116, 15, 67, 15, 54, 15, 15, 41, 41, 36, 129,
129, 129, 36, 36, 129, 129, 36, 129, 36, 67, 129, 129, 129, 116, 23,
129, 36, 36, 85, 85, 85, 129, 23, 173, 23, 85, 129, 129, 129, 36, 36,
36, 36, 36, 36, 36, 28, 28, 36, 28, 36, 28, 54, 54, 54, 129, 23, 49, 49,
49, 23, 23, 23, 142, 98, 49, 98, 36, 98, 98, 142, 142, 23, 98, 49, 49,
23, 23, 142, 142, 49, 23, 49, 36, 49, 49, 98, 98, 111, 93, 23, 23, 49,
49, 49, 49, 111]
[0, 0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7, 7, 15, 15, 10, 23, 10, 111, 18, 18, 18, 106, 5, 26, 13, 13, 21, 21, 21, 34, 8, 109, 8, 29, 16, 16, 16, 104, 11, 24, 24, 24, 11, 11, 112, 112, 19, 32, 19, 32, 19, 19, 107, 107, 6, 27, 27, 27, 14, 14, 14, 102, 22, 115, 22, 14, 22, 22, 35, 35, 9, 22, 110, 110, 9, 9, 30, 30, 17, 30, 17, 92, 17, 17, 105, 105, 12, 118, 25, 25, 25, 25, 25, 87, 12, 38, 12, 100, 113, 113, 113, 69, 20, 12, 33, 33, 20, 20, 33, 33, 20, 95, 20, 46, 108, 108, 108, 46, 7, 121, 28, 28, 28, 28, 28, 41, 15, 90, 15, 41, 15, 15, 103, 103, 23, 116, 116, 116, 23, 23, 15, 15, 23, 36, 23, 85, 36, 36, 36, 54, 10, 98, 23, 23, 111, 111, 111, 67, 10, 49, 10, 124, 31, 31, 31, 80, 18, 31, 31, 31, 18, 18, 93, 93, 18, 44, 18, 44, 106, 106, 106, 44, 13, 119, 119, 119, 26, 26, 26, 119, 26, 18, 26, 39, 26, 26, 88, 88, 13, 39, 39, 39, 13, 13, 101, 101, 114, 26, 114, 52, 114, 114, 70, 70, 21, 52, 13, 13, 34, 34, 34, 127, 21, 83, 21, 127, 34, 34, 34, 52, 21, 21, 96, 96, 21, 21, 47, 47, 109, 47, 109, 65, 109, 109, 47, 47, 8, 122, 122, 122, 29, 29, 29, 78, 29, 122, 29, 21, 29, 29, 42, 42, 16, 29, 91, 91, 16, 16, 42, 42, 16, 42, 16, 60, 104, 104, 104, 42, 24, 29, 117, 117, 117, 117, 117, 55, 24, 73, 24, 117, 16, 16, 16, 42, 24, 37, 37, 37, 24, 24, 86, 86, 37, 130, 37, 37, 37, 37, 55, 55, 11, 24, 99, 99, 24, 24, 24, 143, 112, 50, 112, 24, 112, 112, 68, 68, 11, 112, 50, 50, 11, 11, 125, 125, 32, 125, 32, 125, 32, 32, 81, 81, 19, 125, 32, 32, 32, 32, 32, 50, 19, 45, 19, 45, 94, 94, 94, 45, 19, 19, 45, 45, 19, 19, 45, 45, 107, 63, 107, 58, 107, 107, 45, 45, 14, 32, 120, 120, 120, 120, 120, 120, 27, 58, 27, 76, 27, 27, 120, 120, 27, 19, 19, 19, 27, 27, 40, 40, 27, 40, 27, 133, 89, 89, 89, 133, 14, 133, 40, 40, 40, 40, 40, 32, 14, 58, 14, 53, 102, 102, 102, 40, 115, 27, 27, 27, 115, 115, 53, 53, 115, 27, 115, 53, 71, 71, 71, 97, 22, 115, 53, 53, 14, 14, 14, 40, 35, 128, 35, 128, 35, 35, 128, 128, 22, 35, 84, 84, 22, 22, 128, 128, 35, 35, 35, 27, 35, 35, 53, 53, 22, 48, 22, 22, 97, 97, 97, 141, 22, 48, 22, 141, 48, 48, 48, 97, 110, 22, 48, 48, 110, 110, 66, 66, 110, 61, 110, 35, 48, 48, 48, 61, 9, 35, 123, 123, 123, 123, 123, 61, 30, 123, 30, 123, 30, 30, 79, 79, 30, 30, 123, 123, 30, 30, 22, 22, 30, 22, 30, 48, 43, 43, 43, 136, 17, 43, 30, 30, 92, 92, 92, 43, 17, 136, 17, 30, 43, 43, 43, 87, 17, 43, 43, 43, 17, 17, 61, 61, 105, 56, 105, 30, 105, 105, 43, 43, 25, 30, 30, 30, 118, 118, 118, 30, 118, 56, 118, 118, 118, 118, 56, 56, 25, 74, 74, 74, 25, 25, 118, 118, 17, 56, 17, 69, 17, 17, 43, 43, 25, 131, 38, 38, 38, 38, 38, 69, 25, 131, 25, 131, 87, 87, 87, 131, 38, 25, 131, 131, 38, 38, 38, 38, 38, 30, 38, 30, 56, 56, 56, 131, 12, 51, 25, 25, 100, 100, 100, 38, 25, 144, 25, 100, 25, 25, 144, 144, 113, 51, 51, 51, 113, 113, 25, 25, 113, 51, 113, 144, 69, 69, 69, 95, 12, 64, 113, 113, 51, 51, 51, 64, 12, 64, 12, 38, 126, 126, 126, 38, 33, 126, 126, 126, 33, 33, 126, 126, 33, 126, 33, 64, 82, 82, 82, 170, 20, 33, 126, 126, 33, 33, 33, 64, 33, 25, 33, 25, 33, 33, 51, 51, 20, 46, 46, 46, 20, 20, 46, 46, 95, 33, 95, 139, 95, 95, 46, 46, 20, 139, 20, 20, 46, 46, 46, 95, 20, 90, 20, 46, 46, 46, 46, 139, 108, 20, 64, 64, 108, 108, 59, 59, 108, 33, 108, 152, 46, 46, 46, 59, 15, 33, 33, 33, 121, 121, 121, 152, 121, 33, 121, 59, 121, 121, 121, 121, 28, 121, 59, 59, 28, 28, 77, 77, 28, 77, 28, 103, 121, 121, 121, 72, 28, 59, 20, 20, 20, 20, 20, 72, 28, 46, 28, 134, 41, 41, 41, 134, 28, 41, 41, 41, 28, 28, 134, 134, 90, 134, 90, 41, 90, 90, 134, 134, 15, 28, 134, 134, 41, 41, 41, 85, 41, 41, 41, 41, 41, 41, 33, 33, 15, 59, 59, 59, 15, 15, 54, 54, 103, 28, 103, 147, 103, 103, 41, 41, 116, 147, 28, 28, 28, 28, 28, 178, 116, 147, 116, 28, 54, 54, 54, 147, 116, 116, 28, 28, 116, 116, 54, 54, 72, 147, 72, 46, 72, 72, 98, 98, 23, 67, 116, 116, 54, 54, 54, 116, 15, 67, 15, 54, 15, 15, 41, 41, 36, 129, 129, 129, 36, 36, 129, 129, 36, 129, 36, 67, 129, 129, 129, 116, 23, 129, 36, 36, 85, 85, 85, 129, 23, 173, 23, 85, 129, 129, 129, 36, 36, 36, 36, 36, 36, 36, 28, 28, 36, 28, 36, 28, 54, 54, 54, 129, 23, 49, 49, 49, 23, 23, 23, 142, 98, 49, 98, 36, 98, 98, 142, 142, 23, 98, 49, 49, 23, 23, 142, 142, 49, 23, 49, 36, 49, 49, 98, 98, 111, 93, 23, 23, 49, 49, 49, 49, 111]
plot([[i,number_at_distance[i]] for i in range(len(number_at_distance))] ) 
       
line([[i,number_at_distance[i]] for i in range(len(number_at_distance))] ) 
       
for i in range(len(number_at_distance)-4): number_at_distance[i+1]*1.0000/number_at_distance[i] 
       
1.00000000000000
1.00000000000000
1.00000000000000
1.00000000000000
2.00000000000000
1.00000000000000
2.00000000000000
1.00000000000000
1.50000000000000
1.00000000000000
1.33333333333333
1.25000000000000
1.40000000000000
1.28571428571429
1.33333333333333
1.20833333333333
1.24137931034483
1.22222222222222
1.31818181818182
1.24137931034483
1.00000000000000
1.00000000000000
1.00000000000000
1.00000000000000
2.00000000000000
1.00000000000000
2.00000000000000
1.00000000000000
1.50000000000000
1.00000000000000
1.33333333333333
1.25000000000000
1.40000000000000
1.28571428571429
1.33333333333333
1.20833333333333
1.24137931034483
1.22222222222222
1.31818181818182
1.24137931034483
q=1 
       
type(q) 
       
<type 'sage.rings.integer.Integer'>
<type 'sage.rings.integer.Integer'>
q.n() 
       
1.00000000000000
1.00000000000000