We define the digit sum of a non-negative integer to be the sum of its digits. For example, the digit sum of 123 is 1 + 2 + 3 = 6. Let n be a positive integer with n < 10. How many positive integers less than 1000 have digit sum equal to n?

First we should consider how many positive integers less than 100 have digit sum equal to n. The answer should be relatively straight forward for this - it is n+1.For example, if n = 3 then we can have 03,12,21,30, so 4 numbers in total.We shall use this result in our question.
Then we need to consider the following observations:If the number ABC has digit sum equal to n, then the number BC would have digit sum less than n.If B+C is less than n, we can find a unique A such that A+B+C = nsince n<10, the unique A must be a single-digit number.Combining the 3 facts together we can deduce that the number of 3-DIGIT numbers with digit sum n = 1+2....+n (i.e the sum of 2-digit numbers with digit sum less than n) = (n+1)n/2so finally we need to add the number of 2-or-1-digit numbers with digit sum n to the formula above, so the answer is(n+1)n/2 + (n+1) = (n+1)(n+2)/2

RL
Answered by Ron L. MAT tutor

5478 Views

See similar MAT University tutors

Related MAT University answers

All answers ▸

Circle the correct letter: The equation x^3 - 30x^2 + 108x - 104 = 0 has a) No real roots; b) Exactly one real root; c) Three distinct real roots; d) A repeated root.


I've been doing specimen MAT admission test - but I couldn't figure out the answer to the parts III, and IV of question 6 (https://www.maths.ox.ac.uk/system/files/attachments/speca.pdf). Is there some kind of a trick?


Let a and b be positive integers such that a+b = 20. What is the maximum value that (a^2)b can take?


Deduce a formula (in terms of n) for the following sum: sum (2^i * i) where 1<=i<=n, n,i: natural numbers ( one can write this sum as: 1*2^1+ 2*2^2+ .. +n*2^n)


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2025 by IXL Learning