Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how many three-digit multiples of 18 have the sum of the digits also equal 18?

//I coded this question in python here is how i got the ans 25:

from numpy import integer
count=0
finalcount=0

for i in range (100,999):
    if i/18 == int(i/18):
        count= count + 1
        n=i
        if sum([int(d) for d in str(n)])==18:
            finalcount= finalcount + 1

print(finalcount)
// answer is 25
 
PREVIOUS NEXT
Tagged: #multiples #sum #digits #equal
ADD COMMENT
Topic
Name
5+7 =