login
A357437
a(1)=0. If there are terms prior to and different from a(n) which have occurred the same number of times as a(n), then a(n+1) = n - m, where a(m) is the most recent occurrence of such a term. If there are no prior terms with the same number of occurrences as a(n), then a(n+1) = n - m, where a(m) is the most recent occurrence of a(n). If a(n) is a first occurrence and no prior term has occurred once only, then a(n+1) = 0
0
0, 0, 1, 0, 2, 2, 1, 1, 4, 0, 6, 2, 4, 4, 2, 5, 5, 1, 3, 8, 1, 3, 5, 9, 4, 10, 2, 6, 6, 6, 5, 1, 11, 7, 1, 3, 14, 3, 7, 5, 13, 4, 2, 16, 3, 3, 3, 12, 4, 6, 10, 12, 1, 18, 10, 4, 17, 3, 5, 16, 8, 1, 9, 2, 8, 10, 56, 10, 18, 6, 11, 2, 14, 2, 12, 10, 6, 21, 11, 4, 22, 3
OFFSET
1,5
COMMENTS
Unlike Van Eck's sequence, it is plausible that the sequence contains a finite number of zeros, since a zero occurs only after an a(n) with a value that has occurred exactly once, and when there are no other values that have occurred one time. Zeros being finite (or infinite) would require a proof.
EXAMPLE
Before a(9), the sequence so far is 0,0,1,0,2,2,1,1. We look at the number of times the value 1 at a(8) has appeared, which is 3 times. The last number to appear 3 times (which is distinct from our value 1) is 0, so we jump back 4 terms to reach a(4)=0. a(9) is therefore 4. Continuing the sequence, we see that 4 has occurred one time thus far and no other values have occurred just once, so a(10) is automatically set to 0. To find a(11), we see that a(n)=0 has occurred 4 times. Since no other distinct terms have appeared in the sequence 4 times, we go back to the nearest 0, which happened 6 terms ago, so a(11) is 6. To summarize, there is an order of preferences in these three examples: If a(n) occurs k times, then we go back to the last different value where a(m) occurs k times. If a(n) is the only value to occur k times, we go back to the most recent a(m) with that value (besides a(n) itself). If a(n) is the only value to occur only once a(n+1)=0.
CROSSREFS
Cf. A181391.
Sequence in context: A045995 A360625 A157654 * A078692 A273432 A284343
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Sep 28 2022
STATUS
approved