OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..500
EXAMPLE
1225 belongs to the sequence as (1*2*2*5)/(1+2+2+5) =20/10 = 2.
MATHEMATICA
Select[Range[4000], Times@@IntegerDigits[#]==2Total[IntegerDigits[#]]&] (* Harvey P. Dale, Dec 11 2016 *)
PROG
(PARI) SumD(x)= { s=0; while (x>9, s=s+x-10*(x\10); x=x\10); return(s + x) }
ProdD(x)= { p=1; while (x>9, p=p*(x-10*(x\10)); x=x\10); return(p*x) }
{ n=-1; for (m=1, 2111281, if (ProdD(m)==2*SumD(m), write("b062034.txt", n++, " ", m)) ) } \\ Harry J. Smith, Jul 30 2009
(PARI) isok(n) = my(d=digits(n)); vecprod(d)==2*vecsum(d) \\ Mohammed Yaseen, Jul 28 2022
(Python)
from math import prod
def ok(n): d = list(map(int, str(n))); return prod(d) == 2*sum(d)
print([k for k in range(1, 4000) if ok(k)]) # Michael S. Branicky, Jul 28 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 27 2001
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Offset corrected by Mohammed Yaseen, Jul 28 2022
STATUS
approved