OFFSET
1,2
COMMENTS
This sequence was called the Right Arm Reach sequence in a Seqfan thread.
Every positive integer appears, and the index at which k appears is at most k*(k+1)/2. - Pontus von Brömssen, Aug 22 2023
EXAMPLE
Each positive integer k has k "right arm reach". And numbers between k+1 and 2k cannot be within k's right arm reach. We start with a(1) = 1. Now, 2 cannot follow directly because the second position is within the right arm reach of 1. So, a(2) = 3. This step will send 4, 5, and 6 to the "bullpen" waiting for their turns, while 2 can go back to the field since it's out of 1's right arm reach now. a(3) = 2. After that, the least positive integer that's not in the bullpen is 7, so, a(4) = 7. This step will send all the numbers between 8 and 14 to the bullpen. Since we are now in the 3's and 7's right arm reaches, the least available positive integer is 15. So, a(5) = 15. And now we are outside of the 3's right arm reach, so, 4 comes out of the bullpen and a(6) = 4. And so on.
PROG
(Python)
from itertools import islice
def A363584_generator():
alist = []
while True:
x = 1
while True:
for i, a in enumerate(alist):
if a <= x <= 2*a and i <= a-1:
x = 2*a+1
break
if x == a:
x += 1
break
else: break
yield x
alist.insert(0, x)
def A363584_list(nterms):
return list(islice(A363584_generator(), nterms)) # Pontus von Brömssen, Aug 19 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ali Sada, Aug 17 2023
EXTENSIONS
More terms from, and name clarified by Pontus von Brömssen, Aug 22 2023
STATUS
approved