A100795 n occurs n times, as early as possible subject to the constraint that no two successive terms are identical.
1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 7, 8, 7, 8, 7, 8, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12
Offset: 1
Examples
After a(8) = 4 the next term is 5 as 3 has already occurred three times.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a100795 n = a100795_list !! (n-1) a100795_list = f 0 a002024_list where f x ws = v : f v (us ++ vs) where (us, v:vs) = span (== x) ws -- Reinhard Zumkeller, Jan 17 2014
Extensions
Corrected and extended by Ray Chandler, Dec 08 2004
Comments