login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056770 Smallest number that is n times the product of its digits or 0 if impossible. 6
1, 36, 15, 384, 175, 12, 735, 128, 135, 0, 11, 1296, 624, 224, 0, 0, 816, 216, 1197, 0, 315, 132, 115, 0, 0, 0, 2916, 1176, 3915, 0, 93744, 0, 51975, 78962688, 0, 82944, 1184, 0, 0, 0, 31488, 0, 0, 77616, 77175, 4416, 0, 12288, 1715, 0, 612 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(4) = 384 because 4*(product of digits of 384) = 4*96 = 384, and no number smaller than 384 has this property.
MATHEMATICA
Do[k = n; If[Mod[n, 10] == 0, Print[0]; Continue[]]; While[Apply[Times, RealDigits[k][[1]]]*n != k, k += n]; Print[k], {n, 1, 14}]
PROG
(Python)
from itertools import count, combinations_with_replacement
from math import prod
def A056770(n):
if not n%10: return 0
for l in count(1):
if 9**l*n < 10**(l-1): return 0
c = 10**l
for d in combinations_with_replacement(range(1, 10), l):
if sorted(str(a:=prod(d)*n)) == list(str(e) for e in d):
c = min(c, a)
if c < 10**l:
return c # Chai Wah Wu, May 09 2023
CROSSREFS
Sequence in context: A073405 A298572 A260383 * A061038 A058231 A008894
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Aug 16 2000
EXTENSIONS
a(15) onwards from David W. Wilson, Jan 20 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)