book cover
book cover

Programming Projects

Maths: Arithmetic

maintained by Francis Glassborow

  Home     

Palindromic Number Problem [15B]

Contributed by Francis Glassborow

Start with any number of two or more digits. Get a new number by reversing the order of the digits (e.g. 349 becomes 943). Add the original and the reversed number to get a new number. Repeat the process with the new number. Continue until the result is a palindrome (reads the same right-to-left as it does left-to-right).

To find out more about this idea here.

There are quite a few investigations that lead to suitable programming projects. Here are three suggestions

  • Calculate the number of repetitions for a number that the user inputs.
  • List all numbers (expressed in base 10) less than one million that require more than twenty-four reversals.
  • Generalise the above programs so that the user can select which base is used to represent the values.

If you read the material you will find by following the above provided link you will get ideas for very many more projects of varying difficulty.

Program elements

As the concept of reversing the order of the digits concerns the symbols rather than the values you will need to deal with the representation so manipulation of strings and purpose written arithmetic will be necessary.


  Home      Arithmetic      Maths      You Can Do It!