login
Start with the list of positive integers L = {1, 2, 3, ...} and set a(1) = 1. Then, for n = 1, 2, 3, ..., do the following: For each m in 1..a(n), move the number k = L(n+1) to the right by k steps. The number remaining immediately to the right of a(n) becomes a(n+1).
1

%I #31 Aug 22 2023 23:13:57

%S 1,3,6,2,10,9,5,8,22,4,13,15,20,29,7,12,18,32,59,50,19,31,14,81,16,90,

%T 17,25,78,83,21,46,65,23,41,71,64,36,53,47,58,44,35,76,62,43,88,49,

%U 123,116,27,111,40,11,69,30,79,102,24,60,159,73,248,72,55,185,45,101,38,95,141

%N Start with the list of positive integers L = {1, 2, 3, ...} and set a(1) = 1. Then, for n = 1, 2, 3, ..., do the following: For each m in 1..a(n), move the number k = L(n+1) to the right by k steps. The number remaining immediately to the right of a(n) becomes a(n+1).

%C This sequence was called the Annoyance sequence on a Seqfan thread.

%H Neal Gersh Tolunsky, <a href="/A364365/b364365.txt">Table of n, a(n) for n = 1..10000</a>

%e We start with the positive integers:

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...

%e Set a(1) = 1. The number immediately to its right, 2, is annoyed, and moves 2 steps away, so the numbers are now in the order

%e 1, 3, 4, 2, 5, 6, 7, 8, 9, 10, ...

%e Then a(2) = 3, which annoys three numbers: 4 moves 4 steps, giving

%e 1, 3, 2, 5, 6, 7, 4, 8, 9, 10, ...

%e after which 2 moves 2 steps, giving

%e 1, 3, 5, 6, 2, 7, 4, 8, 9, 10, ...

%e and 5 moves 5 steps, giving

%e 1, 3, 6, 2, 7, 4, 8, 5, 9, 10, ....

%e Now a(3) = 6, which annoys six numbers, and so on.

%o (Python)

%o N = 70

%o theList = [1,2,3,4]

%o for i in range(N):

%o # print('Before step %d, the list is: %r' % (i+1, theList))

%o annoyingNumber = theList[i]

%o for d in range(0, annoyingNumber):

%o annoyedNumber = theList[i+1]

%o if (i+2+annoyedNumber >= len(theList)):

%o theList += [j for j in range(len(theList)+1, i+3+annoyedNumber)]

%o theList = theList[:i+1] + theList[i+2:i+2+annoyedNumber] + [annoyedNumber] + theList[i+2+annoyedNumber:]

%o # print(' After %d annoys %d, the list is: %r' % (annoyingNumber, annoyedNumber, theList))

%o print('%r' % theList[:N]) # _Arthur O'Dwyer_, Jul 24 2023

%K nonn

%O 1,2

%A _Ali Sada_, Jul 20 2023