OFFSET
1,2
COMMENTS
Consider each index i as a location from which one can jump a(i) terms forward. To find a(n) we have to check 2 conditions:
1. The value a(n) can be reached in one jump by at most one distinct value.
2. Location n reaches a location in one jump that is not reached in one jump from a location before n.
Another way to view the sequence is to consider the sets of values that can be reached from each distinct integer by a single jump forward (values reached by 1s in the sequence, values reached by 2s, 3s etc.): all of these sets are disjoint.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4)=3 because:
a(4) cannot be 1 because then we would have two distinct values (a(3)=2, a(4)=1) that reach the same future value a(5)=x:
1, 2, 2, 1, x
2---->x
1->x
a(4) cannot be 2 because then we would have two distinct values (a(1)=1, a(2)=2) reach the same value 2:
1, 2, 2, 2
1->2
2---->2
a(4) can be 3 without contradiction since there is only one distinct value that can reach the value 3 (a(2)=2):
1, 2, 2, 3
2---->3
MATHEMATICA
lst={1, 2}; Do[z=1; Quiet@While[l=Join[lst, {z}]; Union[Length@*Union/@ GatherBy[Select[Table[{l[[k]], l[[l[[k]]+k]]}, {k, Length@l}], IntegerQ@Last@#&], Last]]!={1}||
MemberQ[Table[l[[k]]+k, {k, Length@l-1}], Length@l+Last@l], z++]; AppendTo[lst, z], {i, 89}]; lst (* Giorgos Kalogeropoulos, Feb 29 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Feb 06 2024
EXTENSIONS
More terms from Giorgos Kalogeropoulos, Feb 28 2024
STATUS
approved