A268755 Variant of A181391: For n >= 1, if there exists an m < n such that a(m) = a(n), take the largest such m and set a(n+1) = #{a(m), a(m+1), ..., a(n)}; otherwise, a(n+1) = 0. Start with a(1) = 0.
0, 0, 1, 0, 2, 0, 2, 2, 1, 3, 0, 4, 0, 2, 5, 0, 3, 5, 3, 2, 4, 5, 4, 2, 3, 4, 3, 2, 3, 2, 2, 1, 6, 0, 7, 0, 2, 5, 8, 0, 4, 9, 0, 3, 10, 0, 3, 3, 1, 11, 0, 4, 7, 11, 4, 3, 6, 12, 0, 7, 7, 1, 8, 11, 9, 11, 2, 13, 0, 8, 6, 10, 13, 5, 14, 0, 7, 12, 13, 6, 8, 9, 12
Offset: 1
Examples
Example: a(10) = 3. This is because a(9) = 1; the previous occurrence of that number, 1, is at index 3; and in between a(3) and a(9) three distinct numbers occur in the sequence.
Links
- Nathaniel Shar, Table of n, a(n) for n = 1..100000
Comments