OFFSET
1,3
COMMENTS
In other words, a novel term is followed by its binary weight and a repeat term is followed by its cardinality. The sequence is infinite, and all nonzero numbers appear infinitely many times. Zero occurs just twice because it is the only number with zero binary weight. 1 occurs following powers of 2.
a(n) < n.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 3..2^20.
Michael De Vlieger, Log log scatterplot of a(n), n = 3..2^16, with a color function showing m = A000120(a(n-1)) in black for m = 0, red for m = 1, orange for m = 2, ..., magenta for m = 12.
EXAMPLE
a(8) = 3, a novel term, therefore a(9) = 2, the binary weight of 3.
a(12) = 3, occurring for the 2nd time, so a(13) = 2.
MATHEMATICA
nn = 80; c[_] = 0; a[1] = 0; f[n_] := DigitCount[n, 2, 1]; Do[If[c[#] == 0, c[#]++; Set[k, f[#]], c[#]++; Set[k, c[#]]] &[a[n - 1]]; a[n] = k, {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Dec 28 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Dec 27 2022
STATUS
approved