OFFSET
1,3
COMMENTS
The sequence is nondecreasing.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Neal Gersh Tolunsky, Graph of first 16674 run lengths
EXAMPLE
a(3)=2 because a(2)=1 has i - a(i) = 2-1 = 1, which means that 1 cannot be a term (since it can be expressed as i - a(i) for some index i in the sequence thus far). 2 cannot be reached in this way, so a(3)=2.
a(5)=4 because 1 = 2 - a(2) (as seen above); 2 = 4 - a(4); and 3 = 2 + a(2). 4 cannot be the answer to any such expression, so a(5)=4.
Another way to see this is to consider each index i as a location from which one can jump forward or back a(i) terms. To find a(5), we see that there is no way to reach i=4, which is the smallest-indexed location with this property.
0, 1, 2, 2
0<-1
0, 1, 2, 2
1<----2
0, 1, 2, 2
1->2
0, 1, 2, 2
?
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Nov 01 2023
STATUS
approved