A248953 Largest term in wrecker ball sequence starting with n.
0, 1, 2, 3, 21, 26, 6, 6843, 8, 14, 10, 72, 365, 366, 14, 15, 352, 4674389, 18, 22, 891114, 21, 102, 23, 31, 7856204, 26, 27, 28, 1700, 61960674, 3702823, 3702824, 3702825, 3702826, 35, 36, 370, 1047903, 1047904, 596, 41, 42, 43, 2976, 45, 341, 260, 261, 123
Offset: 0
Keywords
Examples
a(0) = max {0} = 0; a(1) = max {1,0} = 1; a(2) = max {2,1,-1,-4,0} = 2; a(3) = max {3,2,0} = 3; a(4) = max {4,3,1,-2,2,-3,-9,-16,-8,-17,-7,-18,-6,7,21,6,-10,-27,...} = 21; a(5) = max {5,4,2,-1,3,-2,-8,-15,-7,-16,-6,-17,-5,8,22,7,-9,-26,...} = 26; a(6) = max {6,5,3,0} = 6; a(7) = max {7,6,4,1,-3,2,-4,3,-5,-14,-24,-13,-1,12,-2,13,29,46,...} = 6843; a(8) = max {8,7,5,2,-2,3,-3,4,-4,-13,-23,-12,0} = 8; a(9) = max {9,8,6,3,-1,4,-2,5,-3,-12,-22,-11,1,14,0} = 14.
Links
- M. F. Hasler, Table of n, a(n) for n = 0..5000 (terms up to n = 1000 from Reinhard Zumkeller), Mar 18 2019
- Gordon Hamilton, Wrecker Ball Sequences, Video, 2013
Crossrefs
Programs
-
Haskell
a248953 n = a248953_list !! n -- See A248952 for definition of a248953_list.
-
Python
#This and sequences A324660-A324692 generated by manipulating this trip function #spots - positions in order with possible repetition #flee - positions from which we move away from zero with possible repetition #stuck - positions from which we move to a spot already visited with possible repetition def trip(n): stucklist = list() spotsvisited = [n] leavingspots = list() turn = 0 forbidden = {n} while n != 0: turn += 1 sign = n // abs(n) st = sign * turn if n - st not in forbidden: n = n - st else: leavingspots.append(n) if n + st in forbidden: stucklist.append(n) n = n + st spotsvisited.append(n) forbidden.add(n) return {'stuck':stucklist, 'spots':spotsvisited, 'turns':turn, 'flee':leavingspots} #Actual sequence def a(n): d = trip(n) return max(d['spots']) # David Nacin, Mar 15 2019 (C++) #include
Extensions
Edited by M. F. Hasler, Mar 18 2019
Comments