# Math Problem 20



## nitrocan (Feb 14, 2009)

I just felt like asking this.

X = 1x(1!) + 2x(2!) + 3x(3!) + 4x(4!) + ..... + 99x(99!)

How many 9's does X have at the end of it?


----------



## Odin (Feb 14, 2009)

Well it depends Nitrocan, what is ! and . equal to? 

SPOLIER
is the answer is 8


----------



## d4m4s74 (Feb 14, 2009)

Odin said:


> Well it depends Nitrocan, what is ! and . equal to?


... means repeat to (1x1 + 2x2 + 3x3, go on till 99)

what ! is, well, I don't know


----------



## JavierS (Feb 14, 2009)

That means factorial: http://en.wikipedia.org/wiki/Factorial

Honestly, I don't even know what I should start with , really, I have no idea...


----------



## Robert-Y (Feb 14, 2009)

Erm do we use algebra?


----------



## nitrocan (Feb 14, 2009)

Just open windows calculator, go to scientific view, and there will be a n! button. It will function like this: n! = 1 x 2 x 3 x 4 x 5 x ... x n but 0! is 1 but you won't need that here. 1! = 1, 2! = 2, 3! = 6, 4! = 24 and so on.


Robert-Y said:


> Erm do we use algebra?


Well it seems like it.


----------



## JavierS (Feb 14, 2009)

Well it's a little bit more complex than saying: let's use algebra lol


----------



## Odin (Feb 14, 2009)

nitrocan said:


> Just open windows calculator, go to scientific view, and there will be a n! button. It will function like this: n! = 1 x 2 x 3 x 4 x 5 x ... x n but 0! is 1 but you won't need that here. 1! = 1, 2! = 2, 3! = 6, 4! = 24 and so on.
> 
> 
> Robert-Y said:
> ...



What if we have a mac :confused::confused:


----------



## Robert-Y (Feb 14, 2009)

Erm the answer isn't zero right? Because if so, that would be annoying! 

Can this problem be solved without the aid of a calculator?


----------



## nitrocan (Feb 14, 2009)

No it's not zero.
@Odin: I have a mac too, just press that green plus until you get that.


----------



## JavierS (Feb 14, 2009)

Robert-Y said:


> Erm the answer isn't zero right? Because if so, that would be annoying!
> 
> Can this problem be solved without the aid of a calculator?



Actually, it can NOT be solved with the aid of a calculator xD


----------



## panyan (Feb 14, 2009)

here you go my friends, took me 2 mins
here: http://www.sendspace.com/file/eq8cmx




ans: 9.427862397658270000000000000000E+155 therefore: no 9's


----------



## nitrocan (Feb 14, 2009)

Umm no you are wrong. That's an estimate.


----------



## JohnnyA (Feb 14, 2009)

Well ... 99! = 99x98x97... 99 times that makes (99x99) x (98x99) x (97x99) x ...

Then 98! = 98x97x ... x98 = (98x98) x (98x97) x ...

Am I on the right track?


----------



## MistArts (Feb 14, 2009)

Is it 99*(99!) or (99*99)! ?


----------



## Robert-Y (Feb 14, 2009)

I think you are. I think that 1x1! + 2x2! ...+ 99x99! covers the times table up to 99


----------



## nitrocan (Feb 14, 2009)

MistArts said:


> Is it 99*(99!) or (99*99)! ?



The first one.



JohnnyA said:


> Well ... 99! = 99x98x97... 99 times that makes (99x99) x (98x99) x (97x99) x ...
> 
> Then 98! = 98x97x ... x98 = (98x98) x (98x97) x ...
> 
> Am I on the right track?



If you go like that, it'll take your life.


----------



## BigSams (Feb 14, 2009)

erm.. i have the same question as Mistarts. where does the factorial fall in BEDMAS?


----------



## nitrocan (Feb 14, 2009)

Well as long as there's no paranthesis, it only applies to the number before it.
Ok, I will make it clearer.


----------



## Robert-Y (Feb 14, 2009)

I still don't get how to figure it out...is it that hard? I'm using the windows calculator btw.


----------



## JohnnyA (Feb 14, 2009)

nitrocan said:


> MistArts said:
> 
> 
> > Is it 99*(99!) or (99*99)! ?
> ...



It's not meant to continue like that, I would find the factorial of every number up to 99 and see what the last digit is, if it adds to 9 the second digit, etc..


----------



## nitrocan (Feb 14, 2009)

Oh my god. Stop using a calculator. It won't help you the smallest bit.



JohnnyA said:


> nitrocan said:
> 
> 
> > MistArts said:
> ...



What if it had like 100 9's?


----------



## BigSams (Feb 14, 2009)

NITROCAN *DONT *GIVE ANY HINTS PLEASE, it would take away all the fun.. yes.. i just said fun


----------



## Robert-Y (Feb 14, 2009)

Oh sorry, I thought you were helping us by telling us to use windows calculator


----------



## MistArts (Feb 14, 2009)

Spoiler



x*x! = (x+1)!-x!

(1*1!)+(2*2!) = 2!-1!+3!-2! = -(1!)+3!

-(1!)+3!+(3*3!) = -(1!)+3!+4!-3! = -(1!)+4!

1*(1!) + 2*(2!) + 3*(3!) + 4*(4!) + ..... + 99*(99!) = -(1!)+100! = 100!-1

I have no idea how to extract digits nor to prove ifthis was right.


----------



## nitrocan (Feb 14, 2009)

MistArts said:


> Spoiler
> 
> 
> 
> ...





Spoiler



This question is all about proving that what you stated is right, lol.



@BigSams: Why do you act as if what you said is weird, maths is fun


----------



## BigSams (Feb 14, 2009)

math is fun, but then there are people who would try to run us over with a truck for saying that. so i added an extra bit of defiance xD


----------



## Robert-Y (Feb 14, 2009)

The answer is at least 2  and that's as far as I've gotten so far


----------



## JohnnyA (Feb 14, 2009)

nitrocan said:


> Oh my god. Stop using a calculator. It won't help you the smallest bit.
> 
> 
> 
> ...



Then it might take, say, at 20 seconds a digit, 2000 seconds? About 20 minutes?


----------



## BigSams (Feb 14, 2009)

you know what..? im just going to go write a program to solve this. would that be cheating?


----------



## Odin (Feb 14, 2009)

Hey Nitrocan can you PM me the answer?


----------



## Robert-Y (Feb 14, 2009)

1x1! + 2x2! ...+ 99x99! = (1^2 x 0!) + (2^2 x 1!) ... + (99^2 x 98!)

Am I getting anywhere?


----------



## Robert-Y (Feb 14, 2009)

Oh wait, I think I might know how to do this, as I've learnt about factorials with algebra a few weeks ago in school.


----------



## fanwuq (Feb 14, 2009)

Hmmm...
Why aren't the usual math people answering this?
Nitrocan, have you solved it yet yourself?
I don't think calculator is useful here. If you must use a program, Excel is probably better than calculator, but that probably won't help either.
I'll think about this.



Spoiler



Edit:
Is it 3?
I got 20922789887999
For sum up to 15th term, then added up the 4th digits up to 18th term and there weren't any more 9's produced.
Solution using Openoffice.org Calc. I can't afford MS Excel. 

Edit2:
I think Tim is right.


----------



## nitrocan (Feb 14, 2009)

fanwuq said:


> Hmmm...
> Why aren't the usual math people answering this?
> Nitrocan, have you solved it yet yourself?
> I don't think calculator is useful here. If you must use a program, Excel is probably better than calculator, but that probably won't help either.
> I'll think about this.



Yes I have the answer.


----------



## Robert-Y (Feb 14, 2009)

I'm trying to factorize to see if that helps, but I don't think it does...


----------



## Tim Reynolds (Feb 14, 2009)

Spoiler



Let f(n)=1*1!+2*2!+...+n*n!. Let's prove by induction that f(n)=(n+1)!-1
We have 1*1! = 2!-1 as a base case. Assume that f(k)=(k+1)!-1 for some k. Then f(k+1)=f(k)+(k+1)*(k+1)!=(k+1)!-1+(k+1)*(k+1)!=(k+1)!(1+k+1)-1=(k+2)!-1, completing the induction. Thus f(99)=100!-1. 100! ends in a bunch of zeros, the number of zeros is exactly the highest k such that 5^k goes into 100!. 100! contains the numbers 5,10,15,20,...,95,100, all of which are divisible by 5, with 25, 50, 75, 100 divisible by 25. Thus there's 24 zeros at the end of 100!. So f(99)=100!-1 ends in 24 9's.



Oh, and excel's not going to help at all, it'll round the number. If you need to use a program, mathematica =P or something else that won't give you large roundoff errors.


----------



## BigSams (Feb 14, 2009)

ok so i wrote the program but the stupid thing writes the final input in scientific form.. but then i noticed a pattern

SPOILERS

the 4th value has one 9 in it, and 4 is 3 away from 1
the 9th value has two 9 in it, and 9 is 5 away from 4
so.. it must go up by an odd number each time another 9 is added, sorry i dont know how to say this!
the numbers at which another 9 is added are:
1 + 3 = 4
4 + 5 = 9
9 + 7 = 16
16 + 9 = 25
25 + 11 = 37
37 + 13 = 50
50 + 15 = 65
65 + 17 = 77
77 + 19 = 96

96 + 21 is more than 99 so anything more than this doesnt count
so in total there are 9 times another 9 is added
therefore there are 9 nines

then again, i could have picked up a wrong pattern


----------



## KubeKid73 (Feb 14, 2009)

BigSams said:


> erm.. i have the same question as Mistarts. where does the factorial fall in BEDMAS?



Am I the only one that noticed this? Isn't it PEMDAS? Not BEDMAS. Lol. Or is this something else?


----------



## BigSams (Feb 14, 2009)

LOL u are saying parenthesis while we say brackets. same thing.


----------



## Sir E Brum (Feb 14, 2009)

I found an easier way to represent this problem.

X = SIGMA (n=1 to 99) n * n!


----------



## nitrocan (Feb 14, 2009)

Yes, it can actually be solved using the SIGMA symbol.


----------



## BigSams (Feb 14, 2009)

ummm so i was wrong? wahh


----------



## MistArts (Feb 14, 2009)

Tim Reynolds said:


> Spoiler
> 
> 
> 
> ...





Spoiler



Wow, I was right about (100!)-1. But how would you know how many 9's are in the middle of the number without the usage of a calculator?

With BCalc, I got:

9.3326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916863999999999999999999999999e+157

Which does end in 24 9's


----------



## KubeKid73 (Feb 14, 2009)

BigSams said:


> LOL u are saying parenthesis while we say brackets. same thing.



There's still a typo.  He said BEDMAS when it would be BEMDAS.


----------



## BigSams (Feb 14, 2009)

-_- r u dumb. Multiply and divide are of the same level, as are adding and subtracting. Bedmas has just become the norm. otherwise it could also be “sa” in the end instead of “as”


----------



## Tim Reynolds (Feb 14, 2009)

MistArts said:


> Spoiler
> 
> 
> 
> ...



The question asks only about 9's at the end, not in the middle.


----------



## nitrocan (Feb 14, 2009)

Solution: (Which has been found already)


Spoiler



n*n! = ((n+1) - 1) * n!
= (n+1)! - n!
So this can be rewritten as such:
2! - 1! + 3! - 2! + 4! - 3! + ....... + 100! - 99!
After the cancellations it's 100! - 1
100! has 24 0's at the end of it. (How many times the 5 factor is in 100! = 24)
So 100! - 1 would have 24 9's


----------



## KubeKid73 (Feb 14, 2009)

I don't care. I say it the right way. The way its taught.


----------



## MistArts (Feb 14, 2009)

KubeKid73 said:


> I don't care. I say it the right way. The way its taught.



They taught the flaws too.


----------



## nitrocan (Feb 14, 2009)

KubeKid73 said:


> I don't care. I say it the right way. The way its taught.



So what? BEDMAS or BEMDAS, what is your gain by knowing the order?


----------



## BigSams (Feb 14, 2009)

damnnnn thats a prety slick solution. i was looking for patterns in a table, and ended up with 9 9s. xD. wrong approach i guess. godd i am so gona fail cayley and galois (math contests). cayley is next wednesday.... TIME TO TRAIINNNN (plays rocky theme)


----------

