Post Reply 
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
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))$$
Find all posts by this user
Quote this message in a reply
Post Reply 




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