login
A062045
Positive numbers whose product of digits is 12 times their sum.
10
666, 1479, 1497, 1568, 1586, 1658, 1685, 1749, 1794, 1856, 1865, 1947, 1974, 2349, 2394, 2439, 2446, 2464, 2493, 2644, 2934, 2943, 3249, 3294, 3345, 3354, 3429, 3435, 3453, 3492, 3534, 3543, 3924, 3942, 4179, 4197, 4239, 4246, 4264, 4293, 4329, 4335, 4353, 4392
OFFSET
1,1
LINKS
EXAMPLE
2349 belongs to the sequence as (2*3*4*9)/(2+3+4+9) = 216/18 = 12.
MATHEMATICA
okQ[n_]:=Module[{idn=IntegerDigits[n]}, Times@@idn/Total[idn]==12]
Select[Range[10000], okQ] (* Harvey P. Dale, Nov 25 2010 *)
PROG
(PARI) isok(n) = my(d=digits(n)); vecprod(d)==12*vecsum(d) \\ Mohammed Yaseen, Sep 12 2022
(Python)
from math import prod
def ok(n): d = list(map(int, str(n))); return prod(d) == 12*sum(d)
print([k for k in range(1, 4400) if ok(k)]) # Michael S. Branicky, Sep 12 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 28 2001
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
More terms from Harvey P. Dale, Nov 25 2010
Offset corrected by Mohammed Yaseen, Sep 12 2022
STATUS
approved