I need to find 2-digit numbers that are divisible by the sum of their digits. I think about 'select' and 'mod', but I don't know how do this.
Marco's way is better, but:
10a+b/.Solve[(10a+b)/k==a+b&&1<=a<=9&&0<=b<=9,{a,b,k},Integers] Out[3]= {10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90}
this is it! Thanks
Hi Artur,
something like this?
Select[ Range[10, 99], Divisible[#, Total[IntegerDigits[#]]] &]
which gives:
{10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90}
Cheers,
Marco