All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Factorial Crossed Nonzero Digits Determination (Posted on 2022-12-01) Difficulty: 3 of 5
Without actual evaluation, determine the last 3 nonzero digits of:
            33! - 23!

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Pencil and Paper | Comment 2 of 4 |
As observed by Larry, we only need to compute the last three digits preceding the terminal zeros of 23! and subtract that from 1000 to get our answer.  
Equivalently I could say we want to calculate  -1 * 23! / (10^4) mod 1000.

Lets start by expanding 23!, but I'm going to group the terms in a special order:
(-1*12*17) * (2*5*10*15*20) * (7*11*31) * (8*9*14) * (3*16*21) * (4*22*23) * (6*18*19) / 10^4

Now each group gets some evaluation: 
-1*12*17 stays as is for now.  
2*5*10*15*20 cancels out the 10^4 leaving behind 3.
7*11*31 = 1001 = 1 mod 1000
8*9*14 = 1008 = 8 mod 1000
3*16*21 = 1008 = 8 mod 1000
4*22*23 = 2*1012 = 2*12 mod 1000
6*18*19 = 2*1026 = 2*26 mod 1000

Now we can plug all this in and get:
-1*12*17 * 3 * 1 * 8 * 8 * 2*12 * 2*26 mod 1000
A bit of rearrangement gives (-1*2^2*13) * (2*3^3*17) * (2^10) mod 1000
-1*2^2*13 stays as is for now
2*3^3*17 = 918 = -82 mod 1000
2^10 = 1024 = 24 mod 1000

Now we are down to -1*2^2*13 * -82 * 24 mod 1000
One more grouping: (-1*-82*13) * (2^2*24)
-1*-82*13 = 1066 = 66 mod 1000
So now down to 66*4*24 mod 1000
11*4*24 = 1056 = 56 mod 1000, which leaves 6*56 = 336 as the answer. (And during this whole solution the largest number I had to ever compute was 1066.)

  Posted by Brian Smith on 2022-12-01 23:33:02
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information