login
A061428
Geometric mean of the digits = 4. In other words, the product of the digits is = 4^k where k is the number of digits.
4
4, 28, 44, 82, 188, 248, 284, 428, 444, 482, 818, 824, 842, 881, 1488, 1848, 1884, 2288, 2448, 2484, 2828, 2844, 2882, 4188, 4248, 4284, 4428, 4444, 4482, 4818, 4824, 4842, 4881, 8148, 8184, 8228, 8244, 8282, 8418, 8424, 8442, 8481, 8814, 8822, 8841, 12888
OFFSET
1,1
LINKS
EXAMPLE
248 is a term as the geometric mean of digits is (2*4*8) = 64 = 4^3.
PROG
(Haskell)
a061428 n = a061428_list !! (n-1)
a061428_list = g [1] where
g ds = if product ds == 4 ^ length ds
then foldr (\d v -> 10 * v + d) 0 ds : g (s ds) else g (s ds)
s [] = [1]; s (8:ds) = 1 : s ds; s (d:ds) = 2*d : ds
-- Reinhard Zumkeller, Jan 13 2014
(Python)
from math import prod
from sympy.utilities.iterables import multiset_combinations, multiset_permutations
def auptod(maxdigits):
n, digs, alst, powsexps2 = 0, 1, [], [(1, 0), (2, 1), (4, 2), (8, 3)]
for digs in range(1, maxdigits+1):
target, okdigs = 4**digs, set()
mcstr = "".join(str(d)*(digs//max(1, r//2)) for d, r in powsexps2)
for mc in multiset_combinations(mcstr, digs):
if prod(map(int, mc)) == target:
n += 1
okdigs |= set("".join(mp) for mp in multiset_permutations(mc, digs))
alst += sorted(map(int, okdigs))
return alst
print(auptod(4)) # Michael S. Branicky, Apr 28 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, May 03 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
STATUS
approved