1. Algebra and fractions

Hi all, I came across this problem and its solution:

There are 5 people A-E. They have alot of oranges. First, A takes 1 orange from the basket, and 1/5 of the remaining. Next, B takes 1 orange, and 1/5 of the remainder again. And So on. What is the least number of oranges that they have?

Basically the solution is 5^5-4.

I came up with a general case whereby

There are n people. They have alot of oranges. First, A takes 1 orange from the basket, and 1/n of the remaining. Next, B takes 1 orange, and 1/n of the remainder again. And So on. What is the least number of oranges that they have?

And the solution should be n^n - (n-1)

I understand the n^n but as for the n-1, I couldn't figure out the logic in it. Could anyone help me with this?

(My apologies if this thread is in the wrong topic)

2. Re: Algebra and fractions

i'm thinking on this...i'm new here so i don't quite know how to come back to your problem, but maybe i can trace it through this response. sorry i don't know what to tell you right now!

3. Re: Algebra and fractions

What? No monkey to give an orange to?

Go here: The On-Line Encyclopedia of Integer Sequences™ (OEIS™)
enter sequence A006091

IF you can call this a "looper formula":
x = n^n - n + 1
DOWHILE (x-1) / n = INTEGER
x = x-1 : x = x - x/n

For similar problems, google "monkey and coconuts"