[Home] [Puzzles & Projects] [Delphi Techniques] [Math topics] [Library] [Utilities]
|
|
Problem Description
The third in the "T-Shirt" series: Back of T-Shirt: "The only known non-palindromic number whose cube is palindrome" Front: __ __ __ __ ? Background & TechniquesI ran across this problem in Chapter 3 of Martin Gardner's book, "The Colossal Book of Mathematics". He reports that C.W. Trigg proved in 1961 that there is only a single palindromic cube less than 1,953,125,000,000 whose cube root is not a palindrome. The program presented here proves the same fact for numbers up to 1018 (cube roots up to 1,000,000). Palindromic integers, by the way, are those that have the same value when written in reverse order. It seems difficult to believe, but Gardner states that it is not known if there are any non-palindromic numbers whose cubes are palindromes other than the one presented here. This program has only about 40 lines of user written code, well within the simple program category, so not much discussion is required. We loop through integers from 10 to 1,000,000 checking whether their cubes are palindromes in an IsPalindrome function. If yes, then add the number and it's cube to a listbox display. Periodically, every 32768 numbers (powers of 2 are fastest for this test), we execute a small loop and call application.processmessages to let the display update and to process any pending Stop button click message. The general form property, Tag, is used as stop flag; set by the Stop button and checked within the search loop. Running/Exploring the Program
Suggestions for Further Explorations
|
[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 2000-2018, Gary Darby All rights reserved. |