# What is the output of this?

#### shroom

##### Coder

Is it 363 or 364?

364

Without getting your calculator, ask yourself if it can be 364. For x=3 all terms are odd, so for n=5 you have a sum of 5 odd numbers. Surely that cannot be even.

Last edited:
This series can be rearranged into a simple expression.
`(x^(n+1) - 1) / (x - 1)`

This series can be rearranged into a simple expression.
`(x^(n+1) - 1) / (x - 1)`
True. But the assignment was to compute a sum. And the question was about the value of the output.

Yes cbreemer.
I would code the sum, and use the expression to test the output, for more than one case.

Yes cbreemer.
I would code the sum, and use the expression to test the output, for more than one case.
Ok ! Never hurts to have an alternative method to check things.

Without getting your calculator, ask yourself if it can be 364. For x=3 all terms are odd, so for n=5 you have a sum of 5 odd numbers. Surely that cannot be even.
It’s 1+ (the sum of 5 odd numbers) - so that has to be even.

It’s 1+ (the sum of 5 odd numbers) - so that has to be even.
Ah yes of course. I forgot to count the zero power 🙄 The reasoning stands though - there should be no doubt between 363 or 364.