A268696 a(1)=1; thereafter a(n+1) = floor(m/2), where m = number of occurrences of a(n) in [a(1),...,a(n)].
1, 0, 0, 1, 1, 1, 2, 0, 1, 2, 1, 3, 0, 2, 1, 3, 1, 4, 0, 2, 2, 2, 3, 1, 4, 1, 5, 0, 3, 2, 3, 2, 4, 1, 5, 1, 6, 0, 3, 3, 3, 4, 2, 4, 2, 5, 1, 6, 1, 7, 0, 4, 3, 4, 3, 5, 2, 5, 2, 6, 1, 7, 1, 8, 0, 4, 4, 4, 5, 3, 5, 3, 6, 2, 6, 2, 7, 1, 8, 1, 9, 0, 5, 4, 5, 4, 6, 3, 6, 3, 7, 2, 7, 2, 8, 1, 9, 1, 10, 0
Offset: 1
Examples
a(2) is equal to the number of times a(1) = 1 appears in the sequence before, divided by two, rounding down. Since 1 appears once before, a(2) = floor(1/2) = 0. a(3) is equal to the number of times 0 appears in the sequence before, which is again once, divided by two, rounding down. So a(3) = floor(1/2) = 0. a(4) is the number of times 0 appears before (twice) divided by two, which gives us 1.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..3000, Feb 12 2016 [First 998 terms from David Seelmann]
Programs
-
Mathematica
a = {1}; Do[AppendTo[a, Floor[Count[a, n_ /; n == a[[k - 1]]]/2]], {k, 2, 120}]; a (* Michael De Vlieger, Feb 11 2016 *)
Extensions
More terms from Michael De Vlieger, Feb 11 2016
Comments