login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A324671 Starting at n, a(n) is the distance from zero of the farthest point visited 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 from zero instead. 1
0, 1, 4, 3, 47, 46, 6, 6843, 23, 22, 10, 72, 471, 470, 29, 15, 352, 4843985, 39, 38, 891114, 21, 102, 57, 56, 7856204, 45, 44, 28, 1700, 61960674, 3702823, 3702824, 3702825, 3702826, 51, 36, 370, 1213998, 1213997, 596, 62, 61, 60, 3855, 45, 417, 260, 261, 237 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Table of n, a(n) for n=0..49.

David Nacin, A324671

David Nacin, A324671(n)/A228474(n)

EXAMPLE

For n=2, the points visited are 2,1,-1,-4,0.  Of those the one farthest from zero is -4 with a distance of 4, hence a(2) = 4.

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}

#Actual sequence

def a(n):

    d = trip(n)

    return max(abs(i) for i in d['spots'])

CROSSREFS

Cf. A228474, A324660-A324692.  Equals max(A248953, -A248952).

Sequence in context: A025175 A248247 A016504 * A249226 A328193 A273878

Adjacent sequences:  A324668 A324669 A324670 * A324672 A324673 A324674

KEYWORD

nonn

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 5 18:53 EDT 2021. Contains 346488 sequences. (Running on oeis4.)