Showing posts with label three digits. Show all posts
Showing posts with label three digits. Show all posts

Tuesday, 15 July 2025

Palindromes Within Palindromes

I'm surprised that I've not covered this sequence before but checking through my previous posts it certainly seems as if I haven't. Here is the sequence in question:


A046351
  Palindromic composite numbers with only palindromic prime factors.

The initial members of this sequence, up to 40000, are (permalink):

4, 6, 8, 9, 22, 33, 44, 55, 66, 77, 88, 99, 121, 202, 242, 252, 262, 303, 343, 363, 393, 404, 484, 505, 525, 606, 616, 626, 686, 707, 808, 909, 939, 1111, 1331, 1441, 1661, 1991, 2112, 2222, 2662, 2772, 2882, 3333, 3443, 3773, 3883, 3993, 4224, 4444, 5445, 5555, 5775, 6336, 6666, 6776, 6886, 7777, 7997, 8448, 8888, 9999, 10201, 12221, 13231, 14641, 15251, 15851, 18281, 19291, 20402, 20602, 22622, 22822, 23232, 24442, 24842, 25152, 25452, 26462, 26662, 28682, 30603, 30903, 31613, 33933, 34643, 35653, 36663, 37673, 37873, 38683, 39693, 39993

There are 94 terms in all. Let's just look at the numbers with two distinct prime factors but each of which is two digits or longer. It can be noted that these numbers have either 11 or 101 as factors.

  number   factors

  1111     11 * 101
  1441     11 * 131
  1661     11 * 151
  1991     11 * 181
  3443     11 * 313
  3883     11 * 353
  7997     11 * 727
  13231    101 * 131
  15251    101 * 151
  18281    101 * 181
  19291    101 * 191
  31613    101 * 313
  35653    101 * 353
  37673    101 * 373
  38683    101 * 383

From the above it can be noted that multiplying a palindrome by 11 or 101 seems to produce another palindrome. By extension, multiplying a palindrome by 1001, 10001, 100001 etc. will often produce another palindrome. For example:$$10001\times 1340431 = 13405650431$$Even a series of alternating 1's and 0's may also produce palindromes. For example:$$10101 \times 1340431 = 13539693531$$However, such products of palindromes are NOT always palindromic. For example:$$ \begin{align} 11 \times 1949999491 &= 21449994401 \\ 101 \times 1949999491 &= 196949948591\\1001\times1940491 &= 1942431491\\10101 \times 1940491 &= 19600899591 \end{align}$$If all the digits of the second palindrome are less than 5 then the multiplication will always produce palindromes.

Tuesday, 6 February 2024

Why Always 1089?

"Why Always 1089?" is the title given to a recent video by Suresh Aggarwal in which he takes any three digit number with no repeating digits and subjects it a series of operations that always returns the number 1089. Let's use 257 as an example.

  • reverse the number, here 257 reversed gives 752
  • subtract the number from its reverse, here 752 - 257 = 495
  • add the result to its reverse, here 495 + 594 = 1089
Suresh's assertion is that the result for any three digit number with no repeating digits is always 1089. It didn't take long for me to determine that this is not always the case. For example, let's take 809 as an example:
  • reversing 809 gives 908
  • subtracting one from the other gives 908 - 809 = 99
  • adding the result to its reverse gives 99 + 99 = 198
Clearly, 1089 can only be obtained if we make use of a leading zero. Thus:
  • reversing 809 gives 908
  • subtracting one from the other gives 908 - 809 = 099
  • adding the result to its reverse gives 099 + 990 = 1089
Suresh needed to add this proviso if his assertion is to be always true. So what's really going on here. This is what is happening:

Assume \(x\) > \(z\) for number \(x \, y \, z\) where \(x\) and \(z\) are different digits.
It doesn't matter what the middle digit is.

(100\(x\) + 10\(y\) + \(z\)) - (100\(z\) - 10\(y\) - \(x\)) = 99(\(x\) - \(z\)) 

\(x\) - \(z\) could be 9, 8, 7, 6, 5, 4, 3, 2 or 1

  • if \(x\) - \(z\) = 9 --> 891 + 198 = 1089
  • if \(x\) - \(z\) = 8 --> 792 + 297 = 1089
  • if \(x\) - \(z\) = 7 --> 693 + 396 = 1089
  • if \(x\) - \(z\) = 6 --> 594 + 495 = 1089
  • if \(x\) - \(z\) = 5 --> 495 + 594 = 1089
  • if \(x\) - \(z\) = 4 --> 396 + 693 = 1089
  • if \(x\) - \(z\) = 3 --> 297 + 972 = 1089
  • if \(x\) - \(z\) = 2 --> 198 + 891 = 1089
  • if \(x\) - \(z\) = 1 --> 099 + 990 = 1089

If the first and last digits differ by 1, then a leading zero must be included. Let's note that:$$1089=3^2 \times 11^2 = 33^2$$As well as being a square number, 1089 is also a nonagonal number, a 32-gonal number, a 364-gonal number, and a centered octagonal number. It turns out that 1089 has some very interesting qualities and the number has its own entry in Wikipedia. For instance it is the first reverse divisible number and is a member of OEIS  A008919:


 A008919

Numbers \(k\) such that \(k\) written backwards is a nontrivial multiple of \(k\).



By trivial is meant palindromes that will naturally divide their reversals and thus satisfy the criterion. The initial members of the sequence are:

1089, 2178, 10989, 21978, 109989, 219978, 1099989, 2199978, 10891089, 10999989, 21782178, 21999978, 108901089, 109999989, 217802178, 219999978, 1089001089, 1098910989, 1099999989, 2178002178, 2197821978, 2199999978, 10890001089

Thus 1089 gives 9801 and 1089 | 9801 = 9 and 2178 = 1089 x 2 and 2178 | 8712 = 4. The ratios are always 1 : 9 or 1 : 4. The number of \(d\)-digit nontrivial reverse divisors is given by the following formula:$$2 \text{F}  \left ( \left \lfloor \frac{d-2}{2} \right \rfloor \right )$$where F(\(i\)) denotes the \(i\)-th Fibonacci number. For example, there are two 4-digit reverse divisible numbers. Checking the formula with \(d\) = 4, we see that \(2\text{F}(1)=2 \times 1 =2\). See Wikipedia entry for Reverse Divisible Number. 

In fact these numbers form OEIS A214927 (permalink):


 A214927

Number of \(n\)-digit numbers N that do not end with 0 and are such that the reversal of N divides N but is different from N.



The initial members of the sequence are:

0, 0, 0, 2, 2, 2, 2, 4, 4, 6, 6, 10, 10, 16, 16, 26, 26, 42, 42, 68, 68, 110, 110, 178, 178, 288, 288, 466, 466, 754, 754, 1220, 1220, 1974, 1974, 3194, 3194, 5168, 5168, 8362, 8362, 13530, 13530, 21892, 21892, 35422, 35422, 57314, 57314, 92736, 92736, 150050, 150050, 242786, 242786, 392836, 392836, 635622, 635622

The Wikipedia article also mentions 1089 in the numerical trickery context mentioned earlier:
1089 is widely used in magic tricks because it can be "produced" from any two three-digit numbers. This allows it to be used as the basis for a Magician's Choice. For instance, one variation of the book test starts by having the spectator choose any two suitable numbers and then apply some basic maths to produce a single four-digit number. That number is always 1089. The spectator is then asked to turn to page 108 of a book and read the 9th word, which the magician has memorized. To the audience it looks like the number is random, but through manipulation, the result is always the same.

Also of passing interest is this comment by G. H. Hardy as quoted in Wikipedia:

The reverse divisor properties of the first two of these numbers, 1089 and 2178, were mentioned by W. W. Rouse Ball in his Mathematical Recreations. In A Mathematician's Apology, G. H. Hardy criticized Rouse Ball for including this problem, writing:

"These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to a mathematician. The proofs are neither difficult nor interesting—merely tiresome. The theorems are not serious; and it is plain that one reason (though perhaps not the most important) is the extreme speciality of both the enunciations and proofs, which are not capable of any significant generalization."

There is a mathematics blog, Math1089 – Mathematics for All!, whose logo is shown above that contains an interesting post about the number 1089 (link). The blog contains posts about many topics other than 1089 and looks like an interesting resource.