cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A028846 Numbers whose product of digits is a power of 2.

This page as a plain text file.
%I A028846 #38 Jun 28 2025 10:01:09
%S A028846 1,2,4,8,11,12,14,18,21,22,24,28,41,42,44,48,81,82,84,88,111,112,114,
%T A028846 118,121,122,124,128,141,142,144,148,181,182,184,188,211,212,214,218,
%U A028846 221,222,224,228,241,242,244,248,281,282,284,288,411,412,414,418,421,422,424,428,441,442,444,448
%N A028846 Numbers whose product of digits is a power of 2.
%C A028846 Numbers using only digits 1, 2, 4, and 8. - _Michel Lagneau_, Dec 01 2010
%H A028846 Bo Gyu Jeong, <a href="/A028846/b028846.txt">Table of n, a(n) for n = 1..5000</a>
%F A028846 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
%e A028846 28 is in the sequence because 2*8 = 2^4. - _Michel Lagneau_, Dec 01 2010
%t A028846 Select[Range[1000], IntegerQ[Log[2, Times @@ (IntegerDigits[#])]] &] (* _Michel Lagneau_, Dec 01 2010 *)
%o A028846 (Haskell)
%o A028846 a028846 n = a028846_list !! (n-1)
%o A028846 a028846_list = f [1] where
%o A028846    f ds = foldr (\d v -> 10 * v + d) 0 ds : f (s ds)
%o A028846    s [] = [1]; s (8:ds) = 1 : s ds; s (d:ds) = 2*d : ds
%o A028846 -- _Reinhard Zumkeller_, Jan 13 2014
%o A028846 (Python)
%o A028846 from itertools import count, islice, product
%o A028846 def agen(): yield from (int("".join(p)) for d in count(1) for p in product("1248", repeat=d))
%o A028846 print(list(islice(agen(), 64))) # _Michael S. Branicky_, Aug 21 2022
%o A028846 (Python)
%o A028846 def A028846(n):
%o A028846     m = (k:=3*n+1).bit_length()-1>>1
%o A028846     return sum(10**j<<((k-(1<<(m<<1)))//(3<<(j<<1))&3) for j in range(m)) # _Chai Wah Wu_, Jun 28 2025
%o A028846 (PARI) is(n)=#setminus(Set(digits(n)), [1,2,4,8])==0 \\ _Charles R Greathouse IV_, Apr 24 2025
%Y A028846 Cf. A007954, A028889, A028838.
%Y A028846 Cf. A174813, A061426.
%K A028846 nonn,base,easy
%O A028846 1,2
%A A028846 _N. J. A. Sloane_
%E A028846 More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)