## pythagoras123 3 years ago Peter and Jane take turns subtracting perfect squares from a given whole number and the person who subtracts the last number to get zero is the winner. If the whole number is 29, and Peter is the first player. what perfect number must he subtract in order for him to definitely win?

1. experimentX

16 then Jane would have to subtract either 4 or 9, then jackpot for Peter

2. pythagoras123

Er.. But Jane can subtract 1 and 16 also..

3. experimentX

Yeah ... it seems that way.

4. experimentX

29 = 25 + 4 = 16 + 9 + 4 but there's no other way. If Jane subtracts 1 ... then it would ruin game.

5. pythagoras123

29= 16+1+9+1+1+1 Jane would then draw the last one

6. asnaseer

It might be best here to work in reverse. i.e. write down the outcome if, after your turn, Jane was left with 1, 2, 3, etc

7. asnaseer

you can then build up to a point where you can work out your best move

8. experimentX

the other way seem to be 16+4+1+1+1+1+1+1+1+1+1 and 16+1+1+1+1+1+1+1+1+1+1+1+1+1 for Peter to win, I don't think peter will win if jane does not cooperate.

9. asnaseer

here is the table I worked out so far: after Peter moves, if he leaves: 1 => Jane wins 2 => Jane wins 3 => Peter wins 4 => Jane wins 5 => Jane wins 6 => Peter wins 7 => Jane wins 8 => Jane wins 9 => Jane wins 10 => Jane wins 11 => Peter wins 12 => Jane wins 13 => Peter wins so, as experimentX suggested, if Peter takes 16 first, that will leave 13 which means he would win.

10. experimentX

it seems rather like game of odd - even