A383421 a(1)=1; thereafter if a(n-1) is a first occurrence, then a(n) is the number of values that occur exactly once in the sequence thus far. Otherwise; a(n) is the number of terms that are the same distance away from an earlier equal value as a(n-1) is from its previous last occurrence.
1, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 3, 6, 2, 5, 4, 6, 7, 1, 2, 2, 3, 2, 4, 3, 6, 5, 2, 5, 5, 4, 9, 2, 6, 5, 7, 3, 4, 10, 2, 11, 3, 8, 4, 4, 5, 5, 6, 9, 10, 6, 8, 6, 6, 7, 7, 8, 10, 7, 10, 7, 8, 12, 2, 3, 5, 10, 13, 3, 9, 8, 8, 9, 11, 5, 9, 12, 12
Offset: 1
Keywords
Examples
a(18) = 3: a(17) = 1 has a distance of 5 from its previous last occurrence a(12) = 1. There are a total of 3 terms with a distance of 5 from an earlier equal term; they occur at indices i = 8,9,17. So a(18) = 3.
Links
- Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
- Sean A. Irvine, Java program (github)
- Neal Gersh Tolunsky, Graph of the first 400000 terms