Header tag

Wednesday, 5 March 2025

Calculator Games: Front to Back

This puzzle is not from the Calculator Fun and Games book, but another one that would be suitable (if you had time).  Early indications and preliminary reading indicate that this one could take some time to complete, but let's wade in anyway.

The game would be described in this way:

Take a number (three digits to start with)
Reverse the digits to form a new number
Add the two numbers together (this makes a change from subtracting...!)
If the new number is not a palindrome, continue reversing digits and adding.

Let's start with 456

456+654 = 1110

1110+0111 = 1221 so it's a palindrome.


Let's try 782

782+287 = 1069

1069 + 6901 = 10670

10670 + 7601 = 18271

18271 + 17281 = 35552

35552 + 25553 = 61105

50116 + 61105 = 111221

111221 + 122111 = 233332  which is a palindrome.


And let's try a smaller three-digit number, 165

165 + 651 = 816
816 + 618 = 1434
1434 + 4341 = 5775 which is a palindrome.

This is called the Lychrel process, and it's not named after a famous mathematician.  It makes a change!  It was named by a man called Wade van Landingham in 2002, who created the name as a rough anagram of his girlfriend's name, Cheryl.  Unlike most mathematical concepts, this one is not hundreds of years old - this also makes a pleasant change!

There is one number which has not yet been found to form a palindrom after many, many iterations of the Lychrel process, and that's 196.  Innocuous, isn't it?

196 + 691 = 887

887 + 788 = 1675

1675 + 5761 = 7436

7436 + 6347 = 13783

13783 + 38731 = 52514

52514 + 41525 = 94039

94039 + 93049 = 187088

187088 + 880781 = 1067869

1067869 + 9687601 = 10755470

10755470 + 7455701 = 18211171

18211171 + 17111281 = 35322452

35322452 + 25422353 = 60744805

60744805 + 50844706 = 



And at this point, my calculator says "Enough!"  I can't get all the digits any more, and this number still isn't reaching a palindrome.

My spreadsheet goes a little further:

60744805 + 50844706 = 111589511

111589511 + 115985111 = 227574622

227574622 + 226475722 = 454050344

454050344 + 443050454 = 897100798

897100798 + 897001798 = 1794102596

And then starts throwing "#VALUE!" messages at me, without reaching a palindrome.

The general definition for a Lychrel number is one that does not reach a palindrome in fewer than 500 iterations. This is easier to measure compared to 'never reaches a palindrome', and that means that the Lychrel numbers (more than 500 iterations) include 295, 394, 493, 592 and 689.

Some numbers immediately become palindromes after one iteration - these are trivial, commonplace and not very interesting!  For example, 110 + 11 = 121, and any other number where the units value is zero, and the hundreds and tens are both less than five.  The longer ones are definitely more interesting, because there's no obvious pattern (and it reminds me of the Collatz conjecture, which I'll be revisiting soon).  Larger numbers which need more than 500 iterations include 10538, 10553 and 10585.

So: can you find numbers which reach a palindrome before they make your calculator (or your spreadsheet) explode?

Saturday, 1 March 2025

Calculator Fun and Games: Premium Prime Numbers

 PRIME NUMBERS

 Calculator Fun and Games is a maths puzzle book that’s worth its salt: it has a section on prime numbers, as any good maths book does.

Prime numbers are only divisible by themselves and 1, they have no other factors.  1 is not a prime number (by definition), but 2 is, making 2 the only even prime number.


Calculator Fun and Games lists the prime numbers up to 1000, just for good measure.  But is there any relationship between them?  Are they connected?  Are there ways of finding (or generating) them?  And can all this be done with a humble calculator?  Maybe one day.

However, the book points out an interesting fact:  if you

Take a prime number (greater than 3)
Square it
Add 14
Divide by 12

Then the remainder is always 3.

For example:
52 = 25
25 + 14 = 39
39/12 = 3, with a remainder of 3

Let’s take a larger example: 577
5772 = 332929
332929 + 14 = 332943
332943 / 12 = 27745 remainder 3

Alternatively, x2 + 11 always divides exactly by 12.  I’m not sure why Ben Hamilton decided on adding 14… maybe he likes the remainder 3?

Does this apply in reverse?  If I take a number, and subtract 11 and take the square root, do we always get a prime? 

No.  Even if the square root is an integer, it doesn’t mean that the starting number was a prime.  For example, 92-11 = 81, and the square root of 81 is 9.  Only a subset of a = (SQRT(b-11)) will give a as a prime.



TWIN PRIMES

Twin primes are primes with a difference of two; for example, 11 and 13, or 17 and 19.  These are rarer than prime numbers, but it still seems that there will be an infinite number of twin primes.  An example of a larger twin prime is 971 and 973; while the largest known twin primes have 388,342 digits:  they are: 
2996863034895×21290000±1.

Not a number you’d fit on your calculator.  The largest prime number which will fit on an eight-digit calculator (with a good old-fashioned LCD display) is 99,999,989.

Looking at all those nines, I’d like to play Over and Out with it, and see how long it would take to get it down to zero! 😊

Other recent Calculator Fun and Games articles:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams, five digits)
More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero in as few steps as possible)