OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..47000
EXAMPLE
We start by setting a(1) = 1 for A284019(1) = 0. Then after, whenever A284019(k) is equal to some A284019(m) with m < k, we set a(k) = a(m). Otherwise (when the value is a new one, not encountered before), we allot for a(k) the least natural number not present among a(1) .. a(k-1).
For n=3, as A284019(3) = 0, which was already present at n=1, we set a(3) = a(1) = 1.
For n=4, as A284019(4) = -1, which is a new value not encountered before, we set a(4) = 1 + max(a(1),a(2),a(3)) = 2.
For n=5, as A284019(5) = 0, which was already present at n=1, we set a(5) = a(1) = 1.
For n=7, as A284019(7) = -1, which was already present at n=4, we set a(7) = a(4) = 2.
For n=11, as A284019(11) = 1, which is a new value not encountered before (sign matters here), we set a(11) = 1 + max(a(1),..,a(10)) = 3.
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 18 2017
STATUS
approved