login
A367849
Lexicographically earliest infinite sequence of positive integers such that for each n, the values in a path of locations starting from any i=n are all distinct, where jumps are allowed from location i to i+a(i).
4
1, 1, 2, 1, 3, 1, 1, 4, 1, 1, 2, 5, 3, 1, 1, 4, 6, 1, 1, 5, 1, 1, 7, 1, 6, 1, 1, 2, 1, 8, 7, 1, 1, 2, 1, 3, 1, 9, 4, 1, 1, 2, 5, 3, 1, 1, 10, 6, 1, 1, 2, 1, 3, 7, 1, 4, 11, 1, 1, 5, 8, 1, 1, 2, 6, 3, 1, 12, 9, 1, 7, 1, 1, 2, 1, 3, 1, 10, 4, 13, 1, 1, 5, 1, 1, 2, 1, 11, 1, 1, 2, 1, 14, 1, 1, 2, 1, 3
OFFSET
1,3
COMMENTS
Consider each index i as a location from which one can jump a(i) terms forward. No starting index can reach the same value more than once by forward jumps.
The value a(i) at the starting index is not part of the path (and thus allows a(2)=1).
The indices of first occurrences are given by A133263 (essentially triangular numbers + 2).
Changing the definition so that jumps are allowed only from location i to i-a(i) gives A002260.
LINKS
Thomas Scheuerle, Plot of a(1..100000)^2. It is conjectured that only the topmost straight line in this plot will extend into infinity.
Thomas Scheuerle, Partial view of a(1..80000)^2 equalized to Y axis by shear mapping. This shows the different lengths of the increasing sequences.
FORMULA
a(A133263(n)) = n + 1.
EXAMPLE
We can see, for example, that the terms reachable by jumping forward continuously from i=1 are all distinct (and in this case are just the positive integers):
1, 1, 2, 1, 3, 1, 1, 4, 1, 1, 2, 5
*->1->2---->3------->4---------->5
Beginning at i=9 and jumping forward continuously, we get the sequence 1,2,3,4,5,6,7,9 (in which all terms are likewise distinct).
PROG
(MATLAB)
function a = A367849( max_n )
a = zeros(1, max_n); j = find(a == 0, 1);
while ~isempty(j)
a(j) = 1; k = 1;
if j+k < max_n
while a(j+k) == 0
a(j+k) = k;
if j+2*k-1 < max_n
j = j+(k-1); k = k+1;
else
break;
end
end
end
j = find(a == 0, 1);
end
end % Thomas Scheuerle, Dec 09 2023
CROSSREFS
Cf. A367467, A367832, A133263 (index of first occurrences), A362248.
Sequence in context: A156826 A130296 A126705 * A263646 A113924 A335124
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Dec 08 2023
STATUS
approved