OFFSET
1,2
COMMENTS
Numbers using only digits 1, 2, 4, and 8. - Michel Lagneau, Dec 01 2010
LINKS
Bo Gyu Jeong, Table of n, a(n) for n = 1..5000
FORMULA
Given a(0) = 0 and n = 4k - r, where 0 <= r <= 3, a(n) = 10*a(k-1) + 2^(3-r). - Clinton H. Dan, Aug 21 2022
EXAMPLE
28 is in the sequence because 2*8 = 2^4. - Michel Lagneau, Dec 01 2010
MATHEMATICA
Select[Range[1000], IntegerQ[Log[2, Times @@ (IntegerDigits[#])]] &] (* Michel Lagneau, Dec 01 2010 *)
PROG
(Haskell)
a028846 n = a028846_list !! (n-1)
a028846_list = f [1] where
f ds = foldr (\d v -> 10 * v + d) 0 ds : f (s ds)
s [] = [1]; s (8:ds) = 1 : s ds; s (d:ds) = 2*d : ds
-- Reinhard Zumkeller, Jan 13 2014
(Python)
from itertools import count, islice, product
def agen(): yield from (int("".join(p)) for d in count(1) for p in product("1248", repeat=d))
print(list(islice(agen(), 64))) # Michael S. Branicky, Aug 21 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)
STATUS
approved