Last two non zero digits of a factorial.

This topic has expert replies
User avatar
Master | Next Rank: 500 Posts
Posts: 145
Joined: Tue Jan 31, 2012 6:50 am
Location: New Delhi
Thanked: 16 times
Followed by:2 members
GMAT Score:760

Last two non zero digits of a factorial.

by nisagl750 » Fri Feb 01, 2013 9:02 am
We know the power cycle works fine to find out the last digit of any factorial (It will be zero for any factorial greater than 5) and any number raised to the power of another number.
For Eg: Last non zero digit of 123456^123456 = 6 (following the power cycle of 6 which always gives a 6)

I also know that last two non zero digits of a multiplication can be found out by multiplying last two digits of the numbers multiplied.
i.e. last two non zero units digit of 2345*162 = 45*62 = 2790, So last two non zero digits will be 79.


I wanted to know, Is there any formula to find out last two or last three non zero digits of a multiplication?
for eg: last two non zero digits of 237^169?

Is there any general formula or method that we can use to calculate last N non zero digits of a^b or a*b (where a & b can be any positive integers? )

User avatar
MBA Admissions Consultant
Posts: 2279
Joined: Fri Nov 11, 2011 7:51 am
Location: New York
Thanked: 660 times
Followed by:266 members
GMAT Score:770

by Jim@StratusPrep » Tue Feb 05, 2013 2:36 pm
Not that I know of, but, more importantly, this is not something you will need for the gmat
GMAT Answers provides a world class adaptive learning platform.
-- Push button course navigation to simplify planning
-- Daily assignments to fit your exam timeline
-- Organized review that is tailored based on your abiility
-- 1,000s of unique GMAT questions
-- 100s of handwritten 'digital flip books' for OG questions
-- 100% Free Trial and less than $20 per month after.
-- Free GMAT Quantitative Review

Image

User avatar
Master | Next Rank: 500 Posts
Posts: 145
Joined: Tue Jan 31, 2012 6:50 am
Location: New Delhi
Thanked: 16 times
Followed by:2 members
GMAT Score:760

by nisagl750 » Wed Feb 06, 2013 1:54 am
Thanks Jim,

Do last non zero digit problems come in GMAT?

User avatar
Master | Next Rank: 500 Posts
Posts: 194
Joined: Mon Oct 15, 2012 7:14 pm
Location: India
Thanked: 47 times
Followed by:6 members

by The Iceman » Wed Feb 06, 2013 11:21 pm
This problem type is beyond the scope of GMAT, unless the problem involves a factorial of a single digit number (basically a very easy to calculate number). So, please do not invest time on such problems.

However, solely for knowledge purposes I will give you a quick formula to calculate the last non-zero integer of a factorial.

Lets say f(x) denotes the last non zero digit of factorial, then

Case 1: If tens digit of x is odd

f(x)= Last digit of (4*f[x/5]*f(Unit digit of x)); here [x/5] is the greatest integer function

Case 2:If tens digit of x is even

f(x)= Last digit of (6*f[x/5]*f(Unit digit of x)); here [x/5] is the greatest integer function

e.g. Last non zero digit of 37! can be calculated as follows:

f(37)= Last digit of (4*f[37/5]*f(7))= Last digit of (4*f(7)*f(7))= Last digit of (4*4*4) = 4

User avatar
Master | Next Rank: 500 Posts
Posts: 145
Joined: Tue Jan 31, 2012 6:50 am
Location: New Delhi
Thanked: 16 times
Followed by:2 members
GMAT Score:760

by nisagl750 » Thu Feb 07, 2013 12:16 am
The Iceman wrote:This problem type is beyond the scope of GMAT, unless the problem involves a factorial of a single digit number (basically a very easy to calculate number). So, please do not invest time on such problems.

However, solely for knowledge purposes I will give you a quick formula to calculate the last non-zero integer of a factorial.

Lets say f(x) denotes the last non zero digit of factorial, then

Case 1: If tens digit of x is odd

f(x)= Last digit of (4*f[x/5]*f(Unit digit of x)); here [x/5] is the greatest integer function

Case 2:If tens digit of x is even

f(x)= Last digit of (6*f[x/5]*f(Unit digit of x)); here [x/5] is the greatest integer function

e.g. Last non zero digit of 37! can be calculated as follows:

f(37)= Last digit of (4*f[37/5]*f(7))= Last digit of (4*f(7)*f(7))= Last digit of (4*4*4) = 4
Thanks Vineet,

To find out f(7), we have to calculate it or we can apply the above formula again.
Can you please explain giving one 3 digit number example?

-
nisagl
-----------------------------
If I make mistakes please correct me.

User avatar
Master | Next Rank: 500 Posts
Posts: 194
Joined: Mon Oct 15, 2012 7:14 pm
Location: India
Thanked: 47 times
Followed by:6 members

by The Iceman » Thu Feb 07, 2013 2:38 am
nisagl750 wrote: Thanks Vineet,

To find out f(7), we have to calculate it or we can apply the above formula again.
Can you please explain giving one 3 digit number example?

-
nisagl
-----------------------------
If I make mistakes please correct me.
Basically f(1) to f(10) are easy to find. f(3)=6=> f(4)=4=> f(5)=2=> f(6)=2=> f(7)=4=> f(8)=2=> f(9)=8=> f(10)=8

The above formula works only for two digit numbers. Let me give you a formula that works for any integer.

Consider a recursive function f(x) = Last Digit of {(2^m).f(m).f(n)}, where f(x) denotes the last non zero digit of factorial and x=5m+n

f(37)= Last Digit of {(2^7).f(7).f(2)} = last digit of (8*4*2) = 4


f(137)= Last Digit of {(2^27).f(27).f(2)} = last digit of {2^28 * f(27)} = last digit of{2^28 * last digit of(2^5).f(5).f(2)} = last digit of{2^28 * last digit of 2^7}=last digit of{2^35} = 8

User avatar
MBA Admissions Consultant
Posts: 2279
Joined: Fri Nov 11, 2011 7:51 am
Location: New York
Thanked: 660 times
Followed by:266 members
GMAT Score:770

by Jim@StratusPrep » Thu Feb 07, 2013 4:27 am
Point of all this --> don't waste your time with this for the GMAT.
GMAT Answers provides a world class adaptive learning platform.
-- Push button course navigation to simplify planning
-- Daily assignments to fit your exam timeline
-- Organized review that is tailored based on your abiility
-- 1,000s of unique GMAT questions
-- 100s of handwritten 'digital flip books' for OG questions
-- 100% Free Trial and less than $20 per month after.
-- Free GMAT Quantitative Review

Image

User avatar
Master | Next Rank: 500 Posts
Posts: 145
Joined: Tue Jan 31, 2012 6:50 am
Location: New Delhi
Thanked: 16 times
Followed by:2 members
GMAT Score:760

by nisagl750 » Thu Feb 07, 2013 10:03 am
Thanks Vineet and Jim.

I understood how to calculate. But as Jim said, I will not waste more of my time on this topic for GMAT.