login

Revision History for A056770

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Smallest number that is n times the product of its digits or 0 if impossible.
(history; published version)
#21 by Alois P. Heinz at Tue May 09 19:44:25 EDT 2023
STATUS

proposed

approved

#20 by Chai Wah Wu at Tue May 09 14:25:46 EDT 2023
STATUS

editing

proposed

#19 by Chai Wah Wu at Tue May 09 14:25:33 EDT 2023
PROG

return c # Chai Wah Wu, May 09 2023

#18 by Chai Wah Wu at Tue May 09 14:25:18 EDT 2023
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

STATUS

approved

editing

#17 by Alois P. Heinz at Wed Mar 31 19:12:47 EDT 2021
STATUS

editing

approved

#16 by Alois P. Heinz at Wed Mar 31 19:12:20 EDT 2021
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, 5014}]

STATUS

proposed

editing

#15 by Michel Marcus at Wed Mar 31 17:40:18 EDT 2021
STATUS

editing

proposed

Discussion
Wed Mar 31
17:47
Amiram Eldar: For n=15 the While loop runs forever. I suggest to change the "{n, 1, 50}" to "{n, 1, 14}" and maybe add a warning.
18:17
David A. Corneth: Going over terms in A007602 I get the same terms as the b-file. But I'm not entirely sure how to prove a 0. Maybe via if a(n) > 0 then a(n) = n * A002473(k) for some k > 0. A002473(k) can't get too big as the product of digits of n is at least (10/9)^q times as small as n where q is the number of digits of n.
18:29
David A. Corneth: and A002473(k) can't be divisible by 10 which is a big restriction on the search
#14 by Michel Marcus at Wed Mar 31 17:39:13 EDT 2021
EXTENSIONS

a(15) onwards from David W. Wilson, Jan 20 2016

STATUS

proposed

editing

Discussion
Wed Mar 31
17:40
Michel Marcus: RGWv code was "coherent" with the data he gave : terms 1..14
#13 by Michel Marcus at Wed Mar 31 17:31:24 EDT 2021
STATUS

editing

proposed

#12 by Michel Marcus at Wed Mar 31 17:29:29 EDT 2021
CROSSREFS
STATUS

approved

editing

Discussion
Wed Mar 31
17:31
Michel Marcus: Is the Mma really ok ?  for instance, try a(15)