### Random Post

### Recent Posts

- Enigma 1065: Cute cubes
- Enigma 444: Rows and rows
- Puzzle 50: Football and addition
- Enigma 1066: Members of the clubs
- Enigma 443: The bells they are a-changing
- Tantalizer 455: Ballistico
- Tantalizer 456: Square deal
- Enigma 1067: Bye!
- Enigma 442b: Oh yes I did! Oh no you didn’t!
- Puzzle 51: A multiplication

### Recent Comments

Brian Gladman on Enigma 1065: Cute cubes | |

Jim Randell on Enigma 1065: Cute cubes | |

geoffrounce on Enigma 444: Rows and rows | |

Jim Randell on Enigma 444: Rows and rows | |

geoffrounce on Enigma 1611: Three sister… |

### Archives

### Categories

- article (11)
- enigma (1,167)
- misc (2)
- project euler (2)
- puzzle (42)
- site news (45)
- tantalizer (45)
- teaser (3)

### Site Stats

- 180,599 hits

Advertisements

This Python program examines all the possible orders that the piles can be picked up in. It runs in 37ms.

Solution:Your chosen number was 10.On the first deal the “10” card would appear in pile 1, and the piles are collected as pile 1 + pile 2 + pile 3.

On the second deal the “10” card would appear in pile 1, and the piles are collected as pile 2 + pile 1 + pile 3.

On the third deal the “10” card would appear in pile 1, and the piles are collected as pile 3 + pile 1 + pile 2.

The final order of the cards is: (13, 8, 3, 1, 18, 7, 2, 17, 12, 10, 5, 16, 11, 6, 4, 21, 19, 14, 9, 20, 15), with the chosen “10” card at position 10, the “5” card at position 11 and the “20” card at position 20.

I don’t think you need to bother with the loop at line 17. Something like this would do: