A383340 a(1)=1; thereafter if a(n-1) is a first occurrence, then a(n) is the number of first occurrences in the sequence thus far. Otherwise, a(n) is the number of terms that are the same number of distinct values away from their previous last occurrence as a(n-1).
1, 1, 1, 2, 1, 1, 3, 2, 1, 2, 2, 4, 2, 3, 1, 2, 3, 4, 3, 4, 5, 1, 1, 5, 6, 1, 5, 6, 7, 1, 4, 2, 1, 8, 2, 9, 3, 1, 3, 7, 2, 4, 3, 5, 2, 6, 3, 7, 1, 4, 5, 6, 2, 7, 3, 8, 4, 9, 5, 1, 6, 7, 2, 8, 3, 9, 4, 10, 1, 11, 2, 5, 1, 8, 12, 3, 1, 9, 2, 10, 13, 3, 4, 2, 5, 3
Offset: 1
Examples
a(17) = 3: a(16) = 2 is separated by 2 distinct values from its previous last occurrence. There are 3 terms in total separated by two distinct values from their previous last occurrence; they are at indices i = 8,9,16. So a(17) = 3.
Links
- Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A383339.