### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Enigma 457: Divided by ex… | |

geoffrounce on Puzzle 44: Men-only Mews | |

Jim Randell on Puzzle 44: Men-only Mews | |

Brian Gladman on Enigma 1053: Home truths | |

Jim Randell on Enigma 1053: Home truths |

### Archives

### Categories

- article (11)
- enigma (1,192)
- misc (3)
- project euler (2)
- puzzle (48)
- site news (47)
- tantalizer (51)
- teaser (3)

### Site Stats

- 186,589 hits

Advertisements

This Python program runs in 55ms.

Solution:The starting number was 192.Most 3-digit numbers resolve quite quickly to a palindromic number, but there are a few that take 10 or more applications of the procedure:

The ones marked with a

?never reach a palindromic number.For numbers not ending in 0 the reverse of that number will also behave in the same way (e.g. 928 will also take 10 applications of the procedure before reaching a palindrome).

Jim, I used your ‘nreverse’ function from enigma.py to easily reverse numbers in my programme.

Without the constraint that the second addition must be three digits, the first number is 174

and there are multiple answers.

Output – 2nd addition not restricted to three digits

(174, 471, 645, 1191, 3102, 5115)

(175, 571, 746, 1393, 5324, 9559)

(183, 381, 564, 1029, 10230, 13431)

(192, 291, 483, 867, 1635, 6996) << answer

(195, 591, 786, 1473, 5214, 9339)

(273, 372, 645, 1191, 3102, 5115)

(274, 472, 746, 1393, 5324, 9559)

(294, 492, 786, 1473, 5214, 9339)

etc