how to tell if a number is a palindrome, 17bii solver
02-12-2017, 02:00 AM (This post was last modified: 02-13-2017 11:44 PM by Don Shepherd.)
Post: #1
 Don Shepherd Senior Member Posts: 745 Joined: Dec 2013
how to tell if a number is a palindrome, 17bii solver
Of course you can just look at a number and tell if it is a palindrome, but I thought it would be neat to write a solver equation to do it. Enter the number as NUM and solve for ANS. If the number you entered is, in fact, a palindrome, it returns the number of matched pairs of digits (5665 would be 2 pairs matched, 47974 would also be 2 pairs matched, with the 9 middle digit being ignored). If the number you entered is not a palindrome, it will beep and display "Solution not found".

$$ANS=0{\times}L(A:IP(LOG(NUM)))+{\Sigma}(I:1: (G(A)+1){\div}2:1:IF(IP(10{\times}FP(NUM{\div}(10^I)))=IP(10{\times}FP(NUM{\div}​(10^{(G(A)+2-I)}))):1:NUM{\div}0))$$
 « Next Oldest | Next Newest »

 Messages In This Thread how to tell if a number is a palindrome, 17bii solver - Don Shepherd - 02-12-2017 02:00 AM

User(s) browsing this thread: 1 Guest(s)