Before you can write any code you need to understand what the code needs to do.
Can you take a value for n and manually work out what the result should be?
Show the steps you took and what the...