Ask a Teacher
HOW TO FIND A GIVEN NUMBER IS PALINDROM |
In mathematics, a palindrome is a number that reads the same forward and backward. For example, 353 and 787. By definition, all numbers that have the same digits such as 4, 11, 55, 222, and 6666 are other examples of such number. Given any numbers, you can use the following simple algorithm to find other palindromes. Step 1: Start with any number. Call it original number. Reverse the digits of the original number Step 2: Call the number whose digits are reversed new number. Add the new number to your original number. Call the number found by adding the new number to the original number test number Step 3: If test number is a palindrome, you are done. If not, use your test number as your original number and repeat the steps above. Example #1: 75 a) Reversing 75 gives 57 Adding 75 and 57 gives 132 b) Reversing 132 gives 231 Adding 132 and 231 gives 363 and we are done! |