A180076 a(n+1) = if it exists, smallest number not occurring earlier that is contained in binary representation of a(n), otherwise: a(n+1) = 3*a(n)+1; a(0) = 0.
0, 1, 4, 2, 7, 3, 10, 5, 16, 8, 25, 6, 19, 9, 28, 12, 37, 18, 55, 11, 34, 17, 52, 13, 40, 20, 61, 14, 43, 21, 64, 32, 97, 24, 73, 36, 109, 22, 67, 33, 100, 50, 151, 23, 70, 35, 106, 26, 79, 15, 46, 139, 69, 208, 80, 241, 30, 91, 27, 82, 41, 124, 31, 94, 47, 142, 71, 214, 53, 160
Offset: 0
Links
Programs
-
Haskell
import Data.List (delete) a180076 n = a180076_list !! n a180076_list :: [Integer] a180076_list = 0 : f 0 [1..] where f x zs = y : f y (delete y zs) where y = if null ys then 3 * x + 1 else head ys ys = [y | y <- takeWhile (< x) zs, binInfix y x] binInfix u v = ib v where ib w = w `mod` m == u || w > u && ib (w `div` 2) m = a062383 u -- Reinhard Zumkeller, Mar 13 2014, Feb 19 2013
Comments