Arithmetic · 8 min
Counting the digits in a number and in a power
Lesson
Digits in n equal floor(log10 n)+1. Digits in a^b equal floor(b log10 a)+1. 10^k has k+1 digits. When you write 1 to n, add 9 for 1-9, 180 for 10-99, and 3 if 100 is included. Multiply a small power out when you can, instead of guessing the log.
Remember these
The number of digits in a positive integer n is floor(log10 n) + 1. You can also read the number and count the characters, when n is small enough to write out. For a power a^b, with a greater than 1, the same rule becomes floor(b log10 a) + 1. Check a few small powers by multiplying, so that the formula is not a guess: 2^10 is 1,024, which has 4 digits; 2^20 is 1,048,576, which has 7 digits; 10^5 is 100,000, which has 6 digits, because 10^k is 1 followed by k zeros. A second kind of question asks how many digits are used when all the integers from 1 to n are written one after another. From 1 to 9 there are 9 one-digit numbers, so 9 digits. From 10 to 99 there are 90 two-digit numbers, so 180 digits. From 100 to 999 there are 900 three-digit numbers, so 2,700 digits. Add a full number such as 100 as 3 more digits if the range includes it. The usual trap is to count 10^k as k digits instead of k+1, or to treat every number from 1 to 20 as a two-digit number, or to forget the +1 in the log formula.
Why the paper asks this
Papers ask for the digits in a power, or for the total digits used in writing 1 to n, and a frequent wrong option is one less than the true count.
Worked example
2^10 = 1,024, so it has 4 digits. From 1 to 10, the digits used are 9 (for 1 to 9) plus 2 (for 10), which is 11, not 10 and not 20.
Common trap
Counting 10^k as k digits, forgetting the +1 in floor(log10 n)+1, or treating every integer from 1 to 20 as if it had two digits.
Source: NCERT mathematics and the SSC, RRB, TSLPRB and banking quantitative syllabi; written in our own words
Sign up to continue learning
This lesson is free to read. Sign up free to open the next lesson in the app, keep your progress, and practise questions on this topic.
Sign up to continue learning