T-Shirt #3

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]




Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.


Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. 


We receive a few cents from each purchase.  Thanks


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Mensa Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa 365 Puzzlers  Calendar 2017

Mensa 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)


Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only




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 & Techniques

I 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 

bulletBrowse source extract 
bulletDownload source 
bulletDownload  executable

Suggestions for Further Explorations

bulletProve that that the result found by this program is the only number meeting the criteria. (:>).


Originally posted: April 23,2002 Modified:May 15, 2018
  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright 2000-2018, Gary Darby    All rights reserved.