Register to reply 
Number of digits in a number? 
Share this thread: 
#1
Feb2311, 09:16 AM

P: 273

I was playing around with my calculator and I noticed that to calculate the number of digits in a number n we have # of digits in n = [log(n) + 1], where log is in base 10 and [] represents the floor function. I after looked this up and it seems like its true. But how would you go about proving something like this? I thought of writing n as its decimal expansion, and then taking the logarithm, but it doesn't seem to get me no where. Any ideas?



#2
Feb2311, 10:00 AM

Mentor
P: 18,293

Let x be a number, then it is easy to see that
x has n digits if and only if [tex]10^{n1}\leq x<10^{n}[/tex]. If we apply your expression on this, then we obtain [tex]n=\log(10^{n1})+1\leq \log(x)+1<\log(10^n)+1=n+1[/tex] This yields that [tex][\log(x)+1]=n[/tex]. 


#3
Feb2311, 10:01 AM

Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,552

A number, n, has "d" digits if and only if [itex]10^{d1}\le n< 10^d[/itex]. Take the logarithm (base 10) of each part of that, using the fact that logarithm is an increasing function.



#4
Feb2311, 10:13 AM

P: 273

Number of digits in a number?
Ahhh didn't think of that. Thanks a lot to both of you! :)



#5
Feb2311, 07:41 PM

P: 828




#6
Feb2311, 09:27 PM

P: 273




Register to reply 
Related Discussions  
Divisibility by 11 for all palindromes with an even number of digits  Calculus & Beyond Homework  6  
A threedigit number is drawn out of the digits from 09.  Set Theory, Logic, Probability, Statistics  1  
100cr digits number writing a paper  General Math  15  
Number of digits in n!  Programming & Computer Science  8  
Question about determining digits of a number  Precalculus Mathematics Homework  1 