Right digits
It's pretty easy to approximate the value of 125!.
It is about 1.8827 * 10^209. Or it maybe be written
as 1.8827E+209 as computed in Excel.
But to get the last 32 digits (right most digits)
it takes some extra work.
What are the right most 32 digits?
It is about 1.8827 * 10^209. Or it maybe be written
as 1.8827E+209 as computed in Excel.
But to get the last 32 digits (right most digits)
it takes some extra work.
What are the right most 32 digits?
Labels: trickofmind





8 Comments:
00000000000000000000000000000000
To Sam,
Wrong by a single digit.
80000000000000000000000000000000
Factorial(125) is
1882677176888926099743767702491600857595403648714924258875982315083531563316135988668829328894959231336464054459300577406301619193413805978188834575585470555243263755650071317708..........
and then the last 32 digits....
80000000000000000000000000000000
OK, so the 31 zeros at the end come from 125! having 31 5's (and many more 2's) in its factors.
So how do you get to the 8 in front of these zeros without having to multiply the whole thing out?
okay so in order for a number to end in all zeroes, it must have a factor of 10^n, where n is the number of zeroes at the end.
Example "900":
Factors 3^2 * 2^2 * 5^2; (2^2 * 5^2) = 10^2 * 3^2; n = 2
125! has a factor of 5^31 (we know this because each number 5,10,15.. counts once, that's 25, then each factor of 25 (25, 50, 75..) counts twice, that's an additional 5, and we know 125 is 5^3, so thats the 31st. It's obvious that there are at least 31 factors of 2 in 125!
(there are many ways to proof this, including setting K = factor of 5, K-1 for all odd K will be an even number...you get the idea, easy proof)
SOOOOO...10^31 is a factor of 125! and therefore the number ends with 31 trailing zeroes. How to quickly deduce the '8' is a little bit beyond me. Hope this helped
also 125! = ONE HUNDRED TWENTY-FIVE
no zeros =)
To find the final non-zero digit with a standard calculator:
multiply the numbers as you would normally: 1*2*3*4*5, etc BUT...
with each intermediate result, first drop any trailing zeros, then drop and leading digits which make the result more than 1000. ie, you're keeping the final 3 meaningful digits.
When you've done the final multiplication (by 125), the last non-zero digit will be the last non-zero digit in the entire huge number 1.9*10^209.
This works because you don't need to know an entire huge number to know what the final digit of any multiplication will be:
nnnnn2 times nnnnnnn3 will always have a final digit of 6 regardless of the other digits, for example.
You throw away the trailing zeros with each intermediate answer because you already know how many there are, but you could go ahead and count how many trailing zeros you've tossed away if you want to know.
If you want to know more than just one final digit, simply do the multiplications but keep more of the intermediate result digits.
so:
1*2 = 2
2*3 = 6
6*4 = 24
24*5 = 120, drop the zero = 12
12*6 = 72
72*7 = 504
504*8 = 4032, drop the 4000 = 32
32*9 = 288
288*10 = 2880, drop the zero = 288
...
704*125 = 88000, drop the zeros = 88
and your final digit is 8.
You can only save the last digit in this example. If you want more digits, keep 4 digits of each intermediate results, then you will know the final two digits before the 31 zeros. Keep 5 intermediate digits, to know final 3 digits, etc.
Post a Comment
Links to this post:
Create a Link
<< Home