Tag: palindrome

  • Can every number be written as a palindrome in some base?

    Can every number be written as a palindrome in some base?

    My muse, Bartholomew, visited me this weekend with a question:

    Can every number be written as a palindrome in some base?

    What’s that mean!?

    Okay — first thing’s first. A palindrome is something that can be written the same way forward as backward. Like mom or 1001. Typically we ignore punctuation, so things like, “Go hang a salami, I’m a lasagna hog,” also count as a palindrome.

    And base means the number system — in our normal world we use base 10. Computers use base 2 (all ones and zeros) and hexadecimal (like the color codes you sometimes see on a computer — hex #ff9900 is the MathFour orange).

    Notice in hexadecimal — using 16 digits — we have to use letters as numbers. I did a video on base 12 arithmetic here — base 12 also uses some letters as numbers.

    So what’s the question again?

    Take any number — say 85. Can you convert it to some other base (like base 2 or base 7 or base 61) so that it looks like a palindrome?

    You can work hard converting numbers — or you can have a spreadsheet or Wolfram Alpha do it for you.

    If you use Wolfram Alpha, put in the statement “convert NUMBER base 10 to base NEW_BASE” — change the blue things, but leave the black ones the same.

    Notice if you convert 85 base 10 to base 84, the result is 1184 — which means every number can be written as a palindrome in the base that is one less than it.

    So 27810 is 11277. And 11 is a palindrome!

    So yes — every number can be written as a palindrome in some base.

    That’s a lame answer!

    You’re right. That’s what mathematicians call a “trivial” solution. It’s true, but it’s pretty lame.

    So let’s rewrite the question to be more interesting.

    Can every number be written as a palindrome in a base less than or equal to 10?

    This lets us use our “normal” digits — and it makes it more natural.

    I put together a spreadsheet to calculate some conversions. The yellow highlights are palindromes. The blue rows — those have no palindromes!

    Not every number can be written as a palindrome!

    That answers the question — but any good mathematician will ask the next question:

    What’s up with the numbers that can’t be written as palindromes?

    I did up to 100 and these numbers didn’t have palindrome conversions:

    19
    25, 29
    39
    47
    53, 58, 59
    69
    75, 76, 79
    84, 87
    90, 94, 95, 96

    Some are primes, some not. One’s even a perfect square!

    I leave the question with you…

    Any thoughts? What happens if you change the question again? Can you ask your children this question?

    Share in the comments — and don’t forget to tweet it!

    You might also like:
  • Palindromes – What's Your Palindrome Number?

    Palindromes – What's Your Palindrome Number?

    A palindrome is a word or phrase (or string of numbers) that reads the same front-to-back and back-to-front.

    Wil, the research guy, in mirror image

    There’re the little ones, like Wow, Mom, Dad and Hannah.

    Then there are big ones, like this one from Jon Agee:

    Go hang a salami, I’m a lasagna hog.

    But there are also words, phrases and names that are almost palindromes.

    But how “almost” is an almost palindrome?

    You can measure the “almost” of a palindrome with a palindrome number (or PALN for short). Here are the rules:

    Adjust the word or name using any of these:

    • Switch any two adjacent letters.
    • Insert a letter anywhere in the word.
    • Remove any letter from the word.

    For each of these increase the PALN by one. The smallest numer of these adjustments that can be made and still have an intelligible sounding “word,” is the palindrome number or PALN.

    Watch how it works…

    Start with something that is an “almost palindrome” – something that has a palindrome in it or lots of the same letters. The go crazy, like this:

    William – the bold part is a palindrome

    We can remove three letters to be left with “illi.” Or we can add A, M and W to the word to get “Mawilliwam.” Either is pronounceable and yields the PALN=3.

    mathchat – the bold part is a palindrome and the parts in italics are the same letters

    Remove the M and then switch the first A and T. So the resulting palindrome is “tahchat.” PALN=2.

    Susannah – bold part is a palindrome and so is the italics part

    As nice as this looks, its PALN is much larger than the other two. Removing the H is helpful, and then adding an extra SUS at the end gives a PALN=4. The result is “Susannasus.”

    Hanna – SO close!

    PALN=1. Simply remove the H or add an H for Hannah or Anna.

    You can use this to teach math!

    Math is about patterns as much as it is about numbers. Recognizing those almost palindromes and playing with them improves cognitive thinking.

    Keep your eyes peeled everyday for almost-palindromes. Use the opportunities to teach math in a way that doesn’t even seem like math.

    Your turn!

    What’s the PALN of your name? Share it in the comments or on Twitter/X.

    Related articles