Number System - Questions & Discussions

what is the last non zero digit of 1786!

(4^n)*2n! this is the formula for finding the last non-zero..where n=1780/10 in the same ques...

1786!=(4)^178(2*17!*81*82*83*84*85*86
4^178(356!)*

=4^178(4^350)(2*350)!(51*52*53*54*55*56)

4^178(4)^350(700!)(51*52*53*54*55*56)

4^178(4)^350(4)^70(2*70)!(51*52*53*54*55*56)

4^178(4)^350(4)^70(140!)(51*52*53*54*55*56)

4^178(4)^350(4)^70(4)^14(2*14)!(51*52*53*54*55*56)

4^178(4)^350(4)^70(4)^14(48!)(51*52*53*54*55*56)

4^178(4)^350(4)^70(4)^14(4)^4(2*4)!(41*42*43*44*45*46*47*4(51*52*53*54*55*56)

4^178(4)^350(4)^70(4)^14(4)^4*8!*(41*42*43*44*45*46*47*4(51*52*53*54*55*56)

4^odd will give u 4 n 4^even will give u 6

4*4*4*4*4*2*( *(2)*(4)

=2 ans

check the bold part.
answer should be 6

hmmm..
i redid using my method and now i am getting answer to be 4
:\

hmmm..
i redid using my method and now i am getting answer to be 4
:\


Can u post ur method??
what is the last non zero digit of 1786!

(4^n)*2n! this is the formula for finding the last non-zero..where n=1780/10 in the same ques...

1786!=(4)^178(2*17!*81*82*83*84*85*86
4^178(356!)*

=4^178(4^35)(2*35)!(51*52*53*54*55*56)

4^178(4)^35(70!)(51*52*53*54*55*56)

4^178(4)^350(4)^7(2*7)!(51*52*53*54*55*56)

4^178(4)^35(4)^7(14!)(51*52*53*54*55*56)

4^178(4)^35(4)^7(4)^14(2*14)!(51*52*53*54*55*56)
=6*4*4*6*4((51*52*53*54*55*56)
=6 ans

=6*4*4*6*4*2*4= 6 ans


Can u pls elaborate a lil bit more...how come 81*82....86
2n =2*178 = 356
so it shud be juz 4^178*(356!) according to ur formula...
also pls tell n = 1780/10 =178 means for finding last non-zero in 12!, n = 1??

we need last non zero digit of 1786!
lets take 1st 10 digits
1.2.3.4.5.6.7.8.9.10
last non zero digit =2.3.4.5.6.7.8.9=8
last digit of 8^176=6
hence last digit of 1786!=last digit of 6.1.2.3.4.5.6=2
wth!!
i feel like i am making a mistake somewhere
some1 point out plzz

we need last non zero digit of 1786!
lets take 1st 10 digits
1.2.3.4.5.6.7.8.9.10
last non zero digit =2.3.4.5.6.7.8.9=8
last digit of 8^176=6
hence last digit of 1786!=last digit of 6.1.2.3.4.5.6=2
wth!!
i feel like i am making a mistake somewhere
some1 point out plzz


I got where u r making mistake! According to u, 20! ll have 4 as its last non-zero digit right? But to ur surprise it's not it ll have 8 as its last non-zero digit! I was also making same mistake earlier but got to know this when i checked the no's one by one. try and see
Guys any idea, how to solve problem like this in an efficient way...I am able to solve this by following some pattern
what is the last non zero digit of 1786!

means like in no. 183400, 4 is the last non-zero digit.


f(1786!) = g(4^178 ) * f(357) * g(1.2.3.4.6/2)
f(1786!) = g(6) * f(357!) * g(2) = 2*f(357!) -- (1)

f(357!) = g(4^35) * f(71) * g(1.2.3.4.6.7/2)
f(357!) = 4*4*f(71!) = 6*f(71!) -- (2)

f(71!) = g(4^7) * f(14!) * g(1)
f(71!) = 4*2 = 8

So, f(357!) = 6*8 = 8
f(1786!) = 8*2 = 6

hey incredible,
u sure 20! last digit is 8??

f(1786!) = g(4^178 ) * f(357) * g(1.2.3.4.6/2)
f(1786!) = g(6) * f(357!) * g(2) = 2*f(357!) -- (1)

f(357!) = g(4^35) * f(71) * g(1.2.3.4.6.7/2)
f(357!) = 4*4*f(71!) = 6*f(71!) -- (2)

f(71!) = g(4^7) * f(14!) * g(1)
f(71!) = 4*2 = 8

So, f(357!) = 6*8 = 8
f(1786!) = 8*2 = 6


Dude juz pls tell how to use this function??
Incredible84 Says
Dude juz pls tell how to use this function??


Just Visit this Post...Your All Doubts Would be Cleared....

Vineet Da's Post On how To Find Last Non-Zero Digit
hey incredible,
u sure 20! last digit is 8??


Right now i m playing with fx-991 MS calci, so i have full confidence on it Moreover, juz for u, take 15!, last significant digit is 8 but 16! has its last significant digit as 9 instead of 8!!! why? coz its not juz unit digit, digits r there LHS and RHS and so adding up, try out buddy.
hey incredible,
u sure 20! last digit is 8??

f(20!) = 4^2 * = 4*(40320) = 4*2 = 8

i referd to tat page..but still i ve some doubts.
how does g(1.2.3.4.6/2) become g(2)

f(1786!) = g(4^178 ) * f(357) * g(1.2.3.4.6/2)
f(1786!) = g(6) * f(357!) * g(2) = 2*f(357!) -- (1)

f(357!) = g(4^35) * f(71) * g(1.2.3.4.6.7/2)
f(357!) = 4*4*f(71!) = 6*f(71!) -- (2)

f(71!) = g(4^7) * f(14!) * g(1)
f(71!) = 4*2 = 8

So, f(357!) = 6*8 = 8
f(1786!) = 8*2 = 6
divishth Says
f(20!) = 4^2 * = 4*(40320) = 4*2 = 8


Dude i guess u did a mistake here...n=2 right so it shud be (2*2)! = 4!

and by this formula ans is coming 4....I guess since calculator was giving some no. * 10^10 so last digit wasn't clear:banghead: i did it manually...its 4... nksbits was correct.
divishth Says
f(20!) = 4^2 * = 4*(40320) = 4*2 = 8



It will be 4 see

f(20) = g(4^) * f() for x = 10k

therefore, it will be 4
i referd to tat page..but still i ve some doubts.
how does g(1.2.3.4.6/2) become g(2)

g(x) represent the last digit of x so 1*2*3*4*6/2 and 2 both have last digit 2 right, so one and same thing:cheers:
i referd to tat page..but still i ve some doubts.
how does g(1.2.3.4.6/2) become g(2)


see when you solve it g(1.2.3.4.6/2) it will become g(72) and g(x) is the last digit of x so g(72) will become 2.........hope it helps

Juz for the benefit of other guys who haven't gone thru that post, m reproducing the concept given by Vineet.nitd here....

Next concept
How to find the last non zero digit of x!?

The following explanation will ensure that the factorial of all the numbers is covered..

Let f(x) be the generating function representing the last non-zero digit of x! and g(x) represent the last digit of x, then we have:

f(x)= g(4^)*f() for x=10k

f(x)= g(4^)*f()*g(1.2.3) for x=10k+m (m is a natural number satisfying 0
f(x)= g(4^)*f()*g((1.2.3.4.6...)/2) for x=10k+m (m is a natural number satisfying 4

[] denotes the greatest integere function.

Remember that the above generating functions are by nature recursive and hence you need to use them that way for factorial of bigger numbers.

My advice would be that you by-heart these functions.

Let us see what the last non zero digit of 37! is?

Clearly it means you should follow the third case as explained above as m=7.

f(37)= g(4^3)*f(7)*g((1.2.3.4.6.7/2) = 4 * 4 * 4 = 4

ok...
my final solution to this problem
we need last non-zero digit of 1786!
this s last digit of 1780!*6!(consider only last digits of 1781,....)
last non zero digit of 6!=2
now last digit of 1.2.3.4.5.6.7.8.9=8
this occurs 178 times
so we need to find last digit of 8^178
but here we havent accounted for the digit changes by 20,30,40,50,60,.....till 1780
so we need to multiply by 178!
hence we need last non zero digit of 178!*2*8^178
last digit of 8^178=last digit of 8^2=4
last digit of 178!=last digit of 8^170*8!*17!
=last digit of 4*8!*17!
=last digit of 4*8!*10!*7!
=2*4*2=6

hence last nonzero digit is 6*2*4
=8
aaarghhh!!
wth is the mistake!!!??
:banghead:

yoyo answer is 4


Yup, but for 20! only.....1786! has ans as 6 according to this concept, we ll have 8,4,3 and 2 in cyclic order for 10!, 20!, 30! ,40! and so on....but apply this formula and u ll get diff ans for 40!