login
Positive numbers whose product of digits is 5 times their sum.
11

%I #18 Aug 02 2022 15:41:35

%S 257,275,345,354,435,453,527,534,543,572,725,752,1258,1285,1528,1582,

%T 1825,1852,2158,2185,2235,2253,2325,2352,2518,2523,2532,2581,2815,

%U 2851,3225,3252,3522,5128,5182,5218,5223,5232,5281,5322,5812,5821,8125,8152

%N Positive numbers whose product of digits is 5 times their sum.

%H Harry J. Smith, <a href="/A062382/b062382.txt">Table of n, a(n) for n = 1..500</a>

%e 2235 belongs to the sequence as (2*2*3*5)/(2+2+3+5) = 60/12 = 5.

%t Select[Range[9000],Times@@IntegerDigits[#]==5*Total[IntegerDigits[#]]&] (* _Harvey P. Dale_, Mar 01 2012 *)

%o (PARI) isok(n) = my(d=digits(n)); vecprod(d)==5*vecsum(d) \\ _Mohammed Yaseen_, Aug 02 2022

%o (Python)

%o from math import prod

%o def ok(n): d = list(map(int, str(n))); return prod(d) == 5*sum(d)

%o print([k for k in range(1, 9000) if ok(k)]) # _Michael S. Branicky_, Aug 02 2022

%Y Cf. A011540, A034710, A062034, A062035, A062036, A062037, A062384, A062040, A062041, A062043, A062045.

%K nonn,base,easy

%O 1,1

%A _Amarnath Murthy_, Jun 27 2001

%E More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001

%E Offset corrected by _Mohammed Yaseen_, Aug 02 2022