1) 2^9876543
a) determine last 3 digits
b) determine first 3 digits
2) find sum of numbers from 1000 to 10000 with distinct digits
3) NO COMPUTER SOFTWARE. how many 0s at the end of 1000!..1001!....all the way to 1005!
1) 2^9876543
a) determine last 3 digits
b) determine first 3 digits
2) find sum of numbers from 1000 to 10000 with distinct digits
3) NO COMPUTER SOFTWARE. how many 0s at the end of 1000!..1001!....all the way to 1005!
Hello, CalcBeginner!
Edit: Okay, you want the number-of-zeros for each factorial.
3) Find the number of 0's at the end of: .
Every factor-of-5 (together with a factor-of-2) contributes a zero to the end of the number.
How many factors-of-5 are in 1000-factorial?
Every 5th number has a factor-of-5: . fives.
But every 25th number has , each of which contributes another 5: . more fives.
And every 125th number has , each of which contributes yet another 5: . more fives.
And every 625th number has , each of which contributes yet another 5: . more five.
Therefore, 1000! contains factors-of-5,
. . . . . . . . and ends in 249 zeros.
How factors-of-5 are in 1001-factorial?
. . Using the same prodecure, we find the same number: 249 final zeros.
The same holds true for 1002-factorial, 1003-factorial and 1004-factorial.
. . Each has 249 final zeros.
We find that 1005! contains: . final zeros
So we have these answers: .
Hi CalcBeginner,
I can address problem 2. Am I to understand that you're not allowed to use computer software for this one either? Because writing a brute force program should be pretty trivial, you just need a doesHaveDistinctDigits() function, and a simple for() loop.
But for a more paper-and-pencil approach, consider that we are looking at simple permutations, except that the first digit has to be treated in a special manner because it cannot be zero.
Before we begin, I'll tell you that the following is a complete solution, so if you want to solve it more on your own (which might increase your opportunity to learn), then you should try to anticipate my next steps, and possibly try stopping part-way through to see if you can complete the rest of the steps on your own.
So, consider 9 cases, which will basically reduce to just one case since they're so similar.
case: first digit is 1:
Numbers of the form 1XYZ, where X, Y, and Z can be any distinct integers from 0 to 9 inclusive other than 1.
It should be evident (I won't offer a proof) that for the permutations of {X, Y, Z}, each digit will appear the same number of times in each position.
So we have 3! ways to arrange them, and each one will appear in each slot 3!/3 times.
So for a particular {X, Y, Z}, we'll have (3!)(1)(10^3) + (3!/3)[(10^2)(X+Y+Z) + (10^1)(X+Y+Z) + (10^0)(X+Y+Z)] = 6000 + (222)(X+Y+Z).
Then we need to work out how many ways to get {X, Y, Z}. There are C(9, 3) ways, where C(n, k) is binomial coefficient "n choose k." Consider that if we fix X, there are C(8, 2) ways to pick {Y, Z}. That means that each digit appears in exactly C(8, 2) of the C(9, 3) combinations. So we have
where is the nth triangle number, and marked in red are those things specific to choosing the digit 1 in the thousands digit place for this case.
Then simply do cases 2-9 and sum them. It looks like this, in case you had any doubt
I have confirmed this works using a brute force algorithm.
For question 1 (a) ,
we have
Also consider (by property of Euler-Phi function )
therefore,
We obtain
so , the answer is .
Can we use calculator to sovle the b part of question one ?
I obtain
EDITED : it is wrong answer , so embarrassed ...
Suppose a number is written in scientific form. That is, , where is a single digit.
This means that . From here it follows that , where . We want the first digits, which can be obtained from . Therefore, we want to compute . Now all what's left is to let and remember that .
The answer is get is .