The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A324678 Starting at n, a(n) is the minimum negative position from which a spot must be revisited on the next move, or zero if no such positions exist, according to the following rules. On the k-th step (k=1,2,3,...) move a distance of k in the direction of zero. If the number landed on has been landed on before, move a distance of k away. 0
0, 0, 0, 0, 0, 0, 0, -3165, 0, 0, 0, 0, -140, -139, 0, 0, 0, -3072845, 0, 0, -383171, 0, 0, 0, 0, -4869724, 0, 0, 0, -217, -31071367, -1854085, -1854084, -1854083, -1854082, 0, 0, -24, -696919, -696918, -26, -1, 0, 0, -1920, 0, -148, -86, -85, -84, -83, -144 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,8
LINKS
EXAMPLE
For n=41, the points visited are 41, 40, 38, 35, 31, 26, 20, 13, 5, -4, 6, -5, 7, -6, 8, -7, 9, -8, 10, -9, 11, -10, 12, -11, -35, -60, -34, -61, -33, -62, -32, -1, -33, 0. The only position from which we are forced to revisit a spot is -1 which forces a return to -33. As this is the only position and it is negative, it is the minimum negative position and thus a(41)=-1.
PROG
(Python)
#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}
def minorzero(x):
if x:
return min(x)
return 0
#Actual sequence
def a(n):
d=trip(n)
return minorzero([i for i in d['stuck'] if i<0])
CROSSREFS
Sequence in context: A151750 A031610 A252636 * A068266 A140350 A309024
KEYWORD
sign
AUTHOR
David Nacin, Mar 10 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 24 16:32 EDT 2024. Contains 372781 sequences. (Running on oeis4.)