SOLUTION: What are the 4 digit numbers with a total of 18. List them. (Zero can be a first digit.) Is there a formula to do it ? Thanx in advance :-)

Algebra.Com
Question 940999: What are the 4 digit numbers with a total of 18. List them. (Zero can be a first digit.) Is there a formula to do it ? Thanx in advance :-)
Answer by richard1234(7193)   (Show Source): You can put this solution on YOUR website!
Assuming you mean digit sum of 18, there are 670 of them, which would take up a lot of space to list here, so here is my Python code:
def counter():
__count = 0
__for a in range(0,10):
____for b in range(0,10):
______for c in range(0,10):
________for d in range(0,10):
__________if a+b+c+d == 18:
____________count += 1
__print count

The generating function for F(x) # of 4-digit numbers with the sum-of-digits property (leading 0's included) is







RELATED QUESTIONS

Suppose n>1. An n-digit number is a list of n digits where the first digit in the list is (answered by stanbon)
I saw this solution online from a tutor (ikelyn). I think there's a mistake in it and i... (answered by math_tutor2020,ikleyn)
How many two-digit whole numbers does not contain zero and any number greater than 1.... (answered by EdenWolf)
How many 4 digit numbers can be made when the first 3 digits can be any digit but the... (answered by Fombitz)
There is a box with a padlock You can open the box if you will be able to know the... (answered by Theo,ikleyn)
If a license plate has 4 letters followed by three numbers, how many license plates can... (answered by edjones)
How many different three-digit numbers can you create if the first digit cannot be a... (answered by Fombitz)
Hi I really need help with these questions please. 1) How many different ways can 8... (answered by edjones)
How many 4 digit numbers can be formed out of the digits (3,4,5,6,7)which are greater... (answered by ikleyn)