1. ## Puzzle 2

Puzzle2

Ok. Here's an easier one.

There once was a king of a rich South Pacific island who decided (in a moment of foolishness no doubt) to give away his fortune.

To make it interesting he decided to have all the citizens line up one day. He gave \$10 to the first person. He gave twice as much to the second person. He gave twice as much as the second person received to the third person. And the sequence continued, each person receiving twice as much as the person in line ahead of them.

There were 475 citizens in the line.

How much money did the king give away?
How much did the last person receive?

Your solution must be produced using tools available only in Alpha Five.

Have fun.

-- tom

2. ## RE: Puzzle 2

Because of Alpha Five's limitation of 19 digits for numeric variables, permit me to change the puzzle slightly.

The number of citizens in line should be 45.

Thanks.

-- tom

3. ## RE: Puzzle 2

Are you going to award the winner with the amount the king gave away or split it between all the entrants?

(:-)))))

kenn

4. ## RE: Puzzle 2

This one was HARDER than the last one! I'm still wondering if I got the last guy right... Check it out.

Stephen,

-- tom

6. ## RE: Puzzle 2

Now - NO PEEKING, people, till YOU have a go!

7. ## RE: Puzzle 2

Tom, I hope this is right, if so I have John to thank.

Nick

8. ## RE: Puzzle 2

Nick, I'm sorry, your script still needs a bit of work. Try setting your loop to smaller numbers to test the results after the first, second, and third gifts are processed.

i.e.

for x = 1 to 1
the answer should be \$10 and \$10

then

for x = 1 to 2
the answer should be \$20 and \$30

then
for x = 1 to 3
the answer should be \$40 and \$70

9. ## RE: Puzzle 2

Thank you Tom, for showing me the error of my ways.

This works! maybe.

Thanks
Nick