cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 08 2023

Keywords

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.

Examples

			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).
		

Crossrefs

Cf. A367467, A367832, A133263 (index of first occurrences), A362248.

Programs

  • 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

Formula

a(A133263(n)) = n + 1.