in reply to Re^2: Challenge: Nearest Palindromic Number
in thread Challenge: Nearest Palindromic Number

I thought so too, but there are close palindromic numbers that do not even have any digits in common, for example 197 has 191 (6) according to my hypothesis, but 202 is closer (5). I think I'll be cutting my losses and exhaustively search the space above the number, up to the distance to the (easily found) next smaller palindromic number. Not elegant.

  • Comment on Re^3: Challenge: Nearest Palindromic Number