A094511 Smallest number distinct from n, not occurring earlier and having in binary representation not more ones than n.
2, 1, 4, 8, 3, 5, 6, 16, 10, 9, 7, 17, 11, 12, 13, 32, 18, 20, 14, 24, 19, 21, 15, 33, 22, 25, 23, 26, 27, 28, 29, 64, 34, 36, 37, 40, 35, 41, 30, 48, 38, 44, 39, 42, 43, 45, 31, 65, 50, 49, 46, 56, 51, 52, 47, 66, 53, 54, 55, 57, 58, 59, 60, 128, 68, 72, 69, 80, 67, 73, 70
Offset: 1
Keywords
Links
Programs
-
Haskell
import Data.List (delete) a094511 n = a094511_list !! (n-1) a094511_list = f 1 [1..] where f x zs = g zs where g (y:ys) = if y /= x && a000120 y <= wt then y : f (x + 1) (delete y zs) else g ys wt = a000120 x -- Reinhard Zumkeller, Nov 23 2014
Comments