Thursday, 5 December 2024

Prime Sums Of Digits, Digits Squared And Digits Cubed

Consider the number 27640 (my diurnal age today) with the property that the sum of its digits cubed is a prime number:$$ \begin{align} 27460 &= 2^3+7^3+6^3+4^3 +0^3\\ &= 631 \text{ (prime)} \end{align} $$However, its sum of digits squared is composite:$$ \begin{align} 27460 &= 2^2+7^2+6^3+4^2 +0^2\\ &= 105 \\&=105 \\ &= 3 \times 5 \times 7 \end{align}$$Then again, its sum of digits is prime:$$ \begin{align} 27460 &= 2+7+6+4 +0\\ &= 19 \text{ (prime)} \end{align} $$So the question can be asked as to what numbers, in the range up to 40,000, have the property that the:

  • sum of digits is a prime number
  • sum of digits squared is a prime number
  • sum of digits cubed is a prime number
It turns out that there are 1985 such numbers and they belong to OEIS A245475:


A245475: numbers \(n\) such that the sum of digits, sum of squares of digits, and sum of cubes of digits are all prime.

The sequence begins (permalink):

11, 101, 110, 111, 113, 131, 146, 164, 166, 199, 223, 232, 289, 298, 311, 322, 335, 337, 346, 353, 355, 364, 373, 388, 416, 436, 449, 461, 463, 494, 533, 535, 553, 566, 614, 616, 634, 641, 643, 656, 661, 665, 733, 829, 838, 883, 892, 919, 928, 944, 982, 991, 1001, 1010, 1011, 1013, 1031, 1046, 1064, 1066, 1099

Of these 1985 numbers in the range up to 40,000, 322 are prime themselves. However, many of these numbers are permutations of the digits of other numbers and so it's pertinent to ask how many "root numbers" are there in the range up to 40,000. These "root numbers" will be numbers whose digits are in ascending order such that any permutation of their digits still ensures membership in OEIS A245475. There are only 99 such numbers and they are:

11, 111, 113, 146, 166, 199, 223, 289, 335, 337, 346, 355, 388, 449, 566, 1112, 1114, 1145, 1147, 1244, 1349, 1448, 1499, 1679, 2225, 2227, 2258, 2333, 2458, 2555, 2557, 3347, 3358, 3367, 3466, 3569, 4445, 4667, 5558, 7888, 11111, 11113, 11117, 11122, 11126, 11128, 11137, 11159, 11234, 11245, 11333, 11344, 11366, 11399, 11489, 11777, 12224, 12248, 12347, 12358, 12446, 12488, 12677, 13333, 13339, 13445, 13478, 14455, 14459, 14558, 16888, 17777, 17779, 22225, 22229, 22258, 22348, 22355, 22447, 22577, 22999, 23444, 23455, 23558, 23699, 24779, 24788, 25589, 25688, 28999, 33335, 33368, 33449, 33689, 34444, 34466, 35777, 36668, 36679

Note that these numbers do not contain any zeroes. This is because we can insert any number of zeroes anywhere we want. For example:$$11 \to 10010$$Of these, the following have digits that are all different:$$146, 289, 346, 1349, 1679, 2458, 3569, 12347, 12358, 13478$$

No comments:

Post a Comment