Showing posts with label product of digits. Show all posts
Showing posts with label product of digits. Show all posts

Saturday, 6 June 2026

Perfect Powers

Firstly a reminder. What is a perfect power?

A perfect power is a positive integer that can be expressed as an integer power of another positive integer. More formally, \(n\) is a perfect power if there exist natural numbers \(m > 1\), and \(k > 1\) such that \(m^k = n\). In this case, \(n\) may be called a perfect \(k\)-th power. If \(k = 2\) or \(k = 3\), then \(n\) is called a perfect square or perfect cube, respectively. Sometimes 1 is also considered a perfect power (\(1^k = 1\) for any \(k\)).
Today I turned 28188 days old and one of the interesting properties of this number, apart from the digit 8 appearing three times, is that its sum of digits (SOD) and product of digits (POD) are both perfect powers. This is because:$$ \begin{align} \text{SOD}(28188) &= 27 = 3^3\\ \text{POD}(28188) &= 1024 = 2^{10 }\end{align}$$This got me thinking as to how many positive integers in the range up to 40000 have this property. Well, it turns out that there are 217 and here they are (permalink):

4, 8, 9, 18, 22, 44, 81, 88, 144, 224, 242, 333, 414, 422, 441, 448, 484, 844, 999, 1124, 1133, 1142, 1177, 1214, 1224, 1241, 1242, 1313, 1331, 1339, 1393, 1412, 1421, 1422, 1555, 1717, 1771, 1888, 1933, 2114, 2124, 2141, 2142, 2214, 2222, 2241, 2248, 2284, 2411, 2412, 2421, 2428, 2482, 2824, 2842, 3113, 3131, 3139, 3193, 3311, 3319, 3391, 3913, 3931, 4112, 4121, 4122, 4211, 4212, 4221, 4228, 4282, 4444, 4822, 5155, 5515, 5551, 7117, 7171, 7711, 8188, 8224, 8242, 8422, 8818, 8881, 8888, 9133, 9313, 9331, 11114, 11124, 11133, 11141, 11142, 11214, 11222, 11241, 11248, 11284, 11313, 11331, 11411, 11412, 11421, 11428, 11482, 11824, 11842, 12114, 12122, 12141, 12148, 12184, 12212, 12221, 12222, 12411, 12418, 12481, 12814, 12841, 12888, 13113, 13131, 13311, 13399, 13939, 13993, 14111, 14112, 14121, 14128, 14182, 14211, 14218, 14281, 14488, 14812, 14821, 14848, 14884, 18124, 18142, 18214, 18241, 18288, 18412, 18421, 18448, 18484, 18828, 18844, 18882, 19339, 19393, 19933, 21114, 21122, 21141, 21148, 21184, 21212, 21221, 21222, 21411, 21418, 21481, 21814, 21841, 21888, 22112, 22121, 22122, 22211, 22212, 22221, 22228, 22282, 22444, 22822, 24111, 24118, 24181, 24244, 24424, 24442, 24811, 28114, 28141, 28188, 28222, 28411, 28818, 28881, 31113, 31131, 31311, 31399, 31939, 31993, 33111, 33199, 33399, 33919, 33939, 33991, 33993, 39139, 39193, 39319, 39339, 39391, 39393, 39913, 39931, 39933

What about numbers whose sums of divisors are perfect powers? In the range up to 40000, there are only 18 and they are (permalink):

3, 7, 21, 31, 81, 93, 127, 217, 381, 400, 651, 889, 2667, 3937, 8191, 11811, 24573, 27559

Take 21 with divisors of 1, 3, 7 and 21 as an example:$$ \sigma(21)=32=2^5$$What about numbers whose totients are perfect powers? Let's recall that:
The totient of a number, denoted by the Euler's totient function \(\phi(n)\), is the count of positive integers less than or equal to \(n\) that are coprime (relatively prime) to \(n\). Two numbers are coprime if their only common factor is 1.
Numbers of this sort are more frequent with there being 119 in the range up to 40000. They are (permalink):

5, 8, 10, 12, 15, 16, 17, 20, 24, 30, 32, 34, 40, 48, 51, 60, 64, 68, 80, 85, 96, 102, 120, 128, 136, 160, 170, 192, 204, 240, 255, 256, 257, 272, 320, 340, 384, 408, 480, 510, 512, 514, 544, 640, 680, 768, 771, 816, 960, 1020, 1024, 1028, 1088, 1280, 1285, 1360, 1536, 1542, 1632, 1920, 2040, 2048, 2056, 2176, 2560, 2570, 2720, 3072, 3084, 3264, 3840, 3855, 4080, 4096, 4112, 4352, 4369, 5120, 5140, 5440, 6144, 6168, 6528, 7680, 7710, 8160, 8192, 8224, 8704, 8738, 10240, 10280, 10880, 12288, 12336, 13056, 13107, 15360, 15420, 16320, 16384, 16448, 17408, 17476, 20480, 20560, 21760, 21845, 24576, 24672, 26112, 26214, 30720, 30840, 32640, 32768, 32896, 34816, 34952

Let's take 20 as an example. The numbers that are coprime to 20 are 1, 3, 7, 9, 11, 13, 17, 19 and so we have we have a count of 8:$$ \phi(20)=8=2^3$$Next, let's consider the sum of the anti-divisors of a number. First let's recall what an antidivisor is using Gemini to explain in very clear terms:

An anti-divisor is a number that fails to divide a target integer by the largest possible margin. While a regular divisor divides a number evenly with no remainder, an anti-divisor leaves the most unbiased, centered remainder possible. [1, 2, 3]
The concept was first formalized by mathematician Jon Perry. [1]
Mathematical Rules
An integer \(d\) (where \(1 < d < n\)) is an anti-divisor of \(n\) if it satisfies one of the following rules: [1, 2]
    • For even values of \(d\): The number \(d\) divides \(2n\) evenly. Mathematically, we have:$$n \bmod d = \dfrac{d}{2}$$
    • For odd values of \(d\): The number \(d\) divides \(2n - 1\) or \(2n + 1\) evenly. Mathematically we have  [1, 2]:$$n \bmod d = \dfrac{d-1}{2}  \text{ or } n \bmod d = \dfrac{d+1}{2}$$
Visual Example: Anti-divisors of 20
To find the anti-divisors of \(20\), you look for numbers between \(2\) and \(19\) that fail to divide \(20\), but cleanly divide \(40\) (twice \(20\)) or \(39\)/\(41\). [1]
    • 3 is an odd anti-divisor because \(3 \times 13 = 39\), leaving a gap of \(1\) (since \(\frac{3-1}{2} = 1\), and \(20 \bmod 3 = 2\)).
    • 8 is an even anti-divisor because \(8 \times 5 = 40\). It divides \(2 \times 20\) perfectly.
    • 13 is an odd anti-divisor because \(13 \times 3 = 39\). [1]
Key Facts
    • The number 1 is never an anti-divisor, as it evenly divides all integers.
    • The number 2 has no anti-divisors.
    • Prime numbers have a limited number of anti-divisors based heavily on multiples of \(2n\). [1, 2, 3]
For a complete look at integer sequences and properties, you can explore the The Anti-Divisor - OEIS catalog. [1]

There are 20 numbers in the range up to 40000 that satisfy and these are (permalink):

6, 8, 9, 14, 36, 89, 96, 221, 541, 576, 740, 778, 1854, 2114, 2571, 10277, 13631, 16160, 16389, 39428

Let's take 39428 as an example. The antidivisors of this number are:

3, 5, 7, 8, 15, 21, 35, 105, 751, 2253, 3755, 5257, 11265, 15771, 26285

The sum of these anti-divisors is \(65536 = 2^{16}\) and so it is perfect power.

Further investigation could target:

  • the sum of the proper divisors
  • the sum of the non-divisors
  • the determinant of the circulant matrix
  • the arithmetic derivative

Saturday, 30 May 2026

Some Categories of Primes

There is a category of prime numbers with the property that when both the sum of their digits and the product of their digits is added to the number then the new, resultant numbers are also prime. An example would be 28181 with a sum of digits of 20 and a product of digits of 128 where:$$ \begin{align} 28181 + 20 &= 28201 \text{ prime} \\ 28181 + 128 &= 28309 \text{ prime} \end{align}$$In the range up to 40000, these primes have a density of 7.376% compared to all primes. Here is a list of such primes between 28000 and 40000 (permalink):

28097, 28181, 28703, 28901, 29153, 29179, 29209, 30089, 30119, 30203, 30313, 30449, 30469, 30539, 30557, 30649, 30661, 30713, 30803, 30809, 30829, 31019, 31307, 32063, 32069, 32083, 32173, 32203, 32401, 32687, 32957, 32971, 33013, 33037, 33091, 33301, 33413, 33547, 33581, 33587, 33769, 33851, 34313, 34667, 35053, 35059, 35251, 35257, 35323, 35507, 35509, 35521, 35569, 35831, 36209, 36229, 36469, 36559, 36607, 36919, 37019, 37039, 37097, 37321, 37369, 37501, 37507, 37547, 37871, 38047, 38351, 38959, 39019, 39079, 39103, 39161, 39301, 39521

These primes constitute OEIS A128717:


A128717: primes that yield another prime if one adds either the sum of its digits or the product of its digits.


Another category of prime involves its cube being pandigital, meaning that each digit from 0 to 9 occurs at least once with duplicates being permitted. Again 28181 satisfies this condition:$$28181^3 = 20753798525641$$Primes of this sort constitute:


A124629: primes \(p\) such that their cubes are pandigital.


The members of this sequence up to 40000 have a density is 1.523 % compared to all primes and these are (permalink):

5437, 6221, 7219, 8443, 10903, 11353, 15937, 17123, 18229, 19429, 20353, 20903, 20929, 21803, 21841, 21961, 22123, 22283, 22993, 23053, 23369, 23663, 24733, 25183, 25219, 25463, 26317, 26387, 26449, 27127, 27481, 28181, 28631, 28711, 28961, 29059, 29443, 29501, 30169, 31153, 31183, 32213, 32801, 33739, 33797, 33811, 33941, 34283, 35027, 35051, 35729, 35963, 36137, 36251, 36383, 36809, 36943, 37223, 37369, 37511, 37619, 37967, 38281, 38917

Another category of prime involves the average of the prime and the next prime being palindromic. Again 28181 satisfies since:$$ \frac{28181+28183}{2}=28182$$Many such primes are the lesser of a twin prime pair but not all. Primes of this sort constitute OEIS A242387:


A242387: lesser of consecutive primes whose average is a palindromic number.


The members of this sequence up to 40000 have a density of 1.213% compared to all primes and these are (permalink):

3, 5, 7, 97, 109, 281, 359, 389, 409, 509, 631, 653, 691, 743, 827, 857, 907, 937, 967, 1549, 2111, 2767, 4219, 4441, 7001, 9007, 9337, 9661, 10099, 11503, 12919, 13421, 16759, 17569, 21011, 21611, 23831, 26261, 26861, 28181, 29287, 29483, 30497, 31307, 32213, 33029, 33629, 34739, 36353, 37463, 39089

Another category of prime involves the differences between consecutive digits. Some primes have consecutive digits that differ by 6 or 7. An example is 28181 where we see that:$$ 2_{ \, 6} \, 8_{ \, 7} \, 1_{ \, 7} \, 8_{ \, 7} \, 1$$Such primes are few and far between and in the range up 40000, there are only the following:

17, 29, 71, 181, 281, 293, 607, 829, 929, 2939, 3929, 8171, 8293, 9281, 9293, 18181, 28181, 39293

Such primes belong to OEIS A048418:


A048418: primes whose consecutive digits differ by 6 or 7.


Yes another category involves totals of composite numbers between successive primes that are palindromes. 28181 qualifies once again because the next prime is its twin 28183 and the interprime number, 28182, is palindromic. Let's consider another prime, 29587. The next prime is 29599 and the composite numbers between them total 325523, a palindrome. Therefore we include 29587. These primes form OEIS A054266 with a density of only 0.8089% of the primes in the range up to 40000:


A054266: sum of composite numbers between prime \(p\) and nextprime(\(p\)) is palindromic.


The members up to 40000 are (permalink):

2, 3, 5, 109, 193, 281, 509, 661, 827, 857, 1439, 2111, 3433, 3889, 3967, 4549, 6661, 7001, 8467, 10099, 17203, 18583, 21011, 21611, 23831, 24847, 25117, 26261, 26497, 26861, 28181, 29587, 30497, 31307

We see that 28181, my diurnal age today, features in all these different categories of primes. Another category of primes (to which 28181 cannot belong) is to consider primes that only consist of non-prime digits (0, 1, 4, 6, 8 and 9). They do not contain any prime digits (2, 3, 5 or 7). Such primes belong to OEIS A034844 and comprise 5.782% of the primes up to 40000:


A034844: primes with only nonprime decimal digits.


Here are the primes up to 40000 (permalink):

11, 19, 41, 61, 89, 101, 109, 149, 181, 191, 199, 401, 409, 419, 449, 461, 491, 499, 601, 619, 641, 661, 691, 809, 811, 881, 911, 919, 941, 991, 1009, 1019, 1049, 1061, 1069, 1091, 1109, 1181, 1409, 1481, 1489, 1499, 1601, 1609, 1619, 1669, 1699, 1801, 1811, 1861, 1889, 1901, 1949, 1999, 4001, 4019, 4049, 4091, 4099, 4111, 4409, 4441, 4481, 4649, 4691, 4801, 4861, 4889, 4909, 4919, 4969, 4999, 6011, 6089, 6091, 6101, 6199, 6449, 6469, 6481, 6491, 6619, 6661, 6689, 6691, 6841, 6869, 6899, 6911, 6949, 6961, 6991, 8009, 8011, 8069, 8081, 8089, 8101, 8111, 8161, 8191, 8419, 8461, 8609, 8641, 8669, 8681, 8689, 8699, 8819, 8849, 8861, 8941, 8969, 8999, 9001, 9011, 9041, 9049, 9091, 9109, 9161, 9181, 9199, 9419, 9461, 9491, 9601, 9619, 9649, 9661, 9689, 9811, 9901, 9941, 9949, 10009, 10061, 10069, 10091, 10099, 10111, 10141, 10169, 10181, 10499, 10601, 10691, 10861, 10889, 10891, 10909, 10949, 11069, 11119, 11149, 11161, 11411, 11489, 11491, 11681, 11689, 11699, 11801, 11909, 11941, 11969, 11981, 14009, 14011, 14081, 14149, 14401, 14411, 14419, 14449, 14461, 14489, 14669, 14699, 14869, 14891, 14969, 16001, 16061, 16069, 16091, 16111, 16141, 16189, 16411, 16481, 16619, 16649, 16661, 16691, 16699, 16811, 16889, 16901, 16981, 18041, 18049, 18061, 18089, 18119, 18149, 18169, 18181, 18191, 18199, 18401, 18461, 18481, 18661, 18691, 18869, 18899, 18911, 18919, 19001, 19009, 19069, 19081, 19141, 19181, 19441, 19469, 19489, 19609, 19661, 19681, 19699, 19801, 19819, 19841, 19861, 19889, 19891, 19919, 19949, 19961, 19991

Primes beginning with 2 or 3 cannot qualify and so it is only when we reach primes beginning with 4 that membership is possible. The first of these is 40009.

We can flip this and consider only those primes that are comprised of prime digits. These form OEIS A019546:


A019546: primes whose digits are primes; primes having only {2, 3, 5, 7} as digits.


These primes have a density of 2.890% of the primes up to 40000 are they are (permalink):

2, 3, 5, 7, 23, 37, 53, 73, 223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 2237, 2273, 2333, 2357, 2377, 2557, 2753, 2777, 3253, 3257, 3323, 3373, 3527, 3533, 3557, 3727, 3733, 5227, 5233, 5237, 5273, 5323, 5333, 5527, 5557, 5573, 5737, 7237, 7253, 7333, 7523, 7537, 7573, 7577, 7723, 7727, 7753, 7757, 22273, 22277, 22573, 22727, 22777, 23227, 23327, 23333, 23357, 23537, 23557, 23753, 23773, 25237, 25253, 25357, 25373, 25523, 25537, 25577, 25733, 27253, 27277, 27337, 27527, 27733, 27737, 27773, 32233, 32237, 32257, 32323, 32327, 32353, 32377, 32533, 32537, 32573, 33223, 33353, 33377, 33533, 33577, 33757, 33773, 35227, 35257, 35323, 35327, 35353, 35527, 35533, 35537, 35573, 35753, 37223, 37253, 37273, 37277, 37337, 37357, 37537, 37573

Wednesday, 2 July 2025

Building Sequences from a Seed Pair

 FIRST EXAMPLE

The numbers 1 and 4 have the interesting properties that:

  • their sum is prime: 1 + 4 = 5
  • their difference is prime: 4 - 1 = 3
  • their product (4) is the average of a pair of twin primes (3 and 5)
Let's make this the starting point of a sequence and let the third member of the sequence be \(x\). This gives us: \(1, 4, x\). We want 4 and \(x\) to share the properties that 1 and 4 enjoyed. Namely:
  • 4 + \(x\) is prime
  • \(x\) - 4 is prime
  • 4 \(\times x\) is the average of a pair of twin primes
A little trial and error shows that the smallest value of \(x\) we are looking for is 15 because:
  • 4 + 15 = 19 is prime
  • 15 - 4 = 11 is prime
  • 4 \( \times \) 15 = 60 is average of a pair of twin pairs (59 and 61)
By using not trial and error but a simple algorithm we can find further terms. The result is OEIS A154493 and the initial terms are:

1, 4, 15, 28, 39, 50, 81, 350, 459, 512, 675, 944, 987, 1040, 1917, 1936, 2325, 2378, 2421, 2588, 2745, 2812, 3459, 3488, 3495, 3506, 5667, 5804, 6027, 6074, 24765, 24832, 25479, 25552, 27621, 27848, 27951, 27980, 34101, 34720, 34773, 35344

SECOND EXAMPLE

Let's take another seed pair with the simple property that the two numbers must add to a cubic number. We'll use 1 and 7 as our seed pair because: \(1 + 7 = 8 = 2^3\). Here we see that the next number must be 20 because \(7+20=27=3^3\). Using an algorithm, the sequence generated begins thus (permalink):

1, 7, 20, 44, 81, 135, 208, 304, 425, 575, 756, 972, 1225, 1519, 1856, 2240, 2673, 3159, 3700, 4300, 4961, 5687, 6480, 7344, 8281, 9295, 10388, 11564, 12825, 14175, 15616, 17152, 18785, 20519, 22356, 24300, 26353, 28519, 30800, 33200, 35721, 38367

THIRD EXAMPLE

Let's start with seed numbers 1 and 2 this time with the property that:
  • the sum of the two numbers has a digit sum that is prime
  • the product of the two numbers plus 1 has a digit product that is prime
The seed pair 1 and 2 satisfy since:
  • the sum of 1 and 2 is 3 and 3 is prime
  • the product of 1 and 2 plus 1 is 3 and 3 is prime
This leads to the following sequence: 1, 2, 9, 12, 13, 16, 18, 23, 24, 25, 27, 29, 32, 33, 34, 40, 45, 47, 51, 60, 62, 66, 100, ... (permalink). There are 2211 terms in the range up to 40000.

Saturday, 7 June 2025

Rara Avis

The number associated with my diurnal age today, \( \textbf{27824}\), is what could be termed a rara avis (someone or something that is rare) because, in the range up to 40,000, there are only three other numbers with which it sharts a certain property. The property is that: 

the sum of their proper divisors minus
the product of their digits equals the number


The numbers are 198, 4172, 7144 and 27824 and they are the initial members of OEIS A331098. Figure 1 shows the details:


Figure 1: permalink

Here is a longer list of the sequence's members:

198, 4172, 7144, 27824, 72212, 111126, 1111134, 1113114, 1131114, 7121212, 11131122, 13111122, 33550336, 111711124, 1111113114, 1111212172, 1113111114, 2111211172, 7111211212, 8589869056, 11112117212, 11113111122, 11121121172, 11711121212, 13111111122, 17112111212

The perfect numbers containing a 0 digit are all in this sequence (33550336 and 8589869056 are shown above).

What if the change the property so that we have:

the sum of their proper divisors minus
the sum of their digits equals the number


In this case, the numbers are more numerous. In the range up to 40000 we have (permalink):

20, 66, 138, 174, 246, 282, 318, 354, 426, 534, 606, 642, 822, 1038, 1074, 1146, 1182, 1362, 1434, 1506, 1542, 1614, 1902, 2082, 2118, 2154, 2334, 2406, 2514, 2802, 3018, 3054, 3126, 3342, 3414, 3522, 3702, 4062, 4206, 4314, 5034, 5142, 5322, 6114, 7122, 7232, 7302, 8202, 8415, 10182, 10254, 10326, 10722, 11082, 11226, 11262, 11334, 11406, 11442, 12018, 12162, 12234, 12414, 12522, 13242, 13422, 13602, 14034, 14106, 14142, 14502, 16122, 17022, 19002, 20082, 20154, 20226, 20334, 20442, 20802, 21162, 21234, 21342, 21702, 22026, 22062, 22206, 22314, 22602, 23106, 23502, 24006, 24042, 24114, 25302, 26022, 27102, 30018, 30054, 30126, 30234, 30306, 30522, 31026, 31134, 31422, 31815, 32106, 32322, 32502, 33006, 33042, 33114, 34014, 34302, 35202

For example, 20 has a sum of proper divisors equal to 22 and its sum of digits is 2, thus 22 - 2 = 20. These numbers form OEIS A331096. Most of the members are even numbers but 8415 and 31815 are odd.

Tuesday, 13 May 2025

An Interesting Sequence of Primes

Consider the sequence of primes and the products of their digits (POD). As the primes increase, these products will reach record values as certain primes are encountered. Table 1 shows these primes above 20000 together with their record products (permalink):


Table 1

Here are the primes without their products (listed in OEIS A230041):

2, 3, 5, 7, 19, 29, 37, 47, 59, 79, 89, 199, 269, 359, 379, 389, 479, 499, 599, 797, 887, 997, 1889, 1999, 2689, 2699, 2789, 2999, 3889, 3989, 4789, 4799, 4889, 4999, 6899, 8999, 25999, 27799, 28789, 28979, 29989, 37799, 37889, 39799, 39989

\( \textbf{27799} \) is the number associated with my diurnal age today which is why I was alerted to this sequence. If we consider both prime and non-prime numbers then the results are shown in Table 2 for numbers greater than 20000.


Table 2

Here is a list of the numbers with record breaking products up to 40000 (see OEIS A095706):

2, 3, 4, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 37, 38, 39, 47, 48, 49, 58, 59, 68, 69, 78, 79, 88, 89, 99, 259, 268, 269, 278, 279, 288, 289, 299, 378, 379, 388, 389, 399, 479, 488, 489, 499, 589, 599, 689, 699, 789, 799, 889, 899, 999, 2599, 2689, 2699, 2789, 2799, 2889, 2899, 2999, 3789, 3799, 3889, 3899, 3999, 4799, 4889, 4899, 4999, 5899, 5999, 6899, 6999, 7899, 7999, 8899, 8999, 9999, 25999, 26899, 26999, 27899, 27999, 28899, 28999, 29999, 37899, 37999, 38899, 38999, 39999

Wednesday, 18 December 2024

Gapful Numbers

 Numbers Aplenty has this to say about gapful numbers:

L. Colucci calls a number \(n\) of at least 3 digits a gapful number if \(n\)  is divisible by the number formed by the first and last digit of \(n\). For example, 583 is gapful because it is divisible by 53. About the 7.46% of the numbers are gapful.

The smallest Pythagorean triple made of gapful numbers is (120, 160, 200) and the first such primitive triple is (3159, 29440, 29609).

The concept can be extended to other bases. For example, the number 240 is gapful in all the bases from 2 to 10 and the number 54288 is gapful in all the bases from 2 to 16.

The first gapful numbers are 100, 105, 108, 110, 120, 121, 130, 132, 135, 140, 143, 150, 154, 160, 165, 170, 176, 180, 187, 190, 192, 195, 198, 200, 220, 225, 231, 240, 242, 253  

Figure 1 shows the representation of \(54288 = 2^4 \times 3^2 \times 13 \times 29\) in bases from 2 to 16:

Figure 1

Looking at the first and last digits in these different representations we see that:

  • Base 2 --> 10 which is 2
  • Base 3 --> 20 which is 6
  • Base 4 --> 30 which is 12
  • Base 5 --> 33 which is 18
  • Base 6 --> 10 which is 6
  • Base 7 --> 33 which is 24
  • Base 8 --> 10 which is 8
  • Base 9 --> 80 which is 72
  • Base 10 --> 58 which is 58
  • Base 11 --> 33 which is 36
  • Base 12 --> 20 which is 24
  • Base 13 --> 10 which is 13
  • Base 14 --> 1a which is 24
  • Base 15 --> 13 which is 18
  • Base 16 --> d0 which is 13 x 16 = 208

All these numbers (2, 6, 8, 12 etc.) are divisors of 54288 and this why the number is so special.

One way to make these gapful numbers less numerous is to impose an additional criterion. For example, let's require that the sum of the number's digits is equal to the concatenation of the first and last digits. In the range between 1 and 40000, this reduces the numbers satisfying all criteria to 359. The numbers are (permalink):

190, 192, 195, 198, 1090, 1092, 1095, 1098, 1180, 1183, 1185, 1188, 1270, 1272, 1274, 1275, 1278, 1360, 1365, 1368, 1450, 1452, 1455, 1456, 1458, 1540, 1545, 1547, 1548, 1630, 1632, 1635, 1638, 1720, 1725, 1728, 1729, 1810, 1812, 1815, 1818, 1900, 1904, 1905, 1908, 2992, 2997, 10090, 10092, 10094, 10095, 10096, 10098, 10180, 10185, 10188, 10270, 10272, 10275, 10278, 10279, 10360, 10365, 10368, 10450, 10452, 10455, 10458, 10540, 10543, 10545, 10548, 10630, 10632, 10635, 10638, 10720, 10724, 10725, 10727, 10728, 10810, 10812, 10815, 10816, 10818, 10900, 10901, 10905, 10908, 11080, 11085, 11088, 11170, 11172, 11175, 11178, 11260, 11265, 11268, 11350, 11352, 11354, 11355, 11358, 11440, 11445, 11448, 11530, 11532, 11535, 11536, 11538, 11620, 11625, 11628, 11710, 11712, 11713, 11715, 11718, 11800, 11805, 11808, 12070, 12072, 12075, 12078, 12160, 12165, 12168, 12250, 12252, 12255, 12256, 12257, 12258, 12340, 12345, 12348, 12430, 12432, 12435, 12438, 12520, 12525, 12528, 12610, 12612, 12614, 12615, 12618, 12700, 12705, 12708, 13060, 13065, 13068, 13150, 13152, 13155, 13158, 13240, 13244, 13245, 13248, 13330, 13332, 13335, 13338, 13420, 13425, 13428, 13510, 13512, 13515, 13518, 13600, 13605, 13608, 14050, 14052, 14053, 14055, 14058, 14140, 14145, 14148, 14230, 14232, 14235, 14238, 14320, 14325, 14328, 14410, 14412, 14415, 14416, 14418, 14500, 14504, 14505, 14508, 15040, 15045, 15048, 15130, 15132, 15134, 15135, 15136, 15138, 15220, 15223, 15225, 15228, 15310, 15312, 15315, 15317, 15318, 15400, 15405, 15408, 15409, 16030, 16032, 16035, 16038, 16120, 16125, 16128, 16210, 16212, 16215, 16218, 16300, 16305, 16308, 17020, 17024, 17025, 17028, 17110, 17112, 17115, 17118, 17119, 17200, 17205, 17208, 18010, 18012, 18015, 18016, 18018, 18100, 18105, 18108, 19000, 19005, 19008, 21897, 21980, 21984, 22792, 22793, 22880, 22975, 22977, 23780, 23782, 23784, 23787, 23875, 23960, 23961, 23968, 24591, 24596, 24597, 24680, 24772, 24775, 24860, 24863, 24864, 24867, 25580, 25584, 25675, 25677, 25760, 25762, 25766, 25851, 25940, 25944, 25947, 26480, 26481, 26487, 26488, 26575, 26660, 26664, 26752, 26757, 26840, 26933, 26936, 27297, 27380, 27384, 27475, 27560, 27567, 27740, 27741, 27742, 27744, 27748, 27837, 27920, 27925, 28280, 28371, 28375, 28377, 28460, 28464, 28640, 28647, 28732, 28739, 28820, 28824, 28825, 28917, 29180, 29184, 29187, 29275, 29276, 29360, 29457, 29540, 29544, 29631, 29720, 29722, 29725, 29727, 29900, 29904, 39990, 39996, 39997

For example, 39997 has a first and last digit concatenation of 37 with a digit of 37 and a factoriation of 23 x 37 x 47. 

If instead, we require the product of the number's digit instead then only five numbers satisfy: 135, 11232, 12132, 12312, 13212 (permalink). For example, 13212 = 2^2 x 3^2 x 367 has a digit product of 12 which is a divisor of the number and 12 is also the concatenation of the first and last digits of the number.

Another criterion that could be applied is to require that the first and last digits be the same. In this case 227 numbers satisfy in the range up to 40000. They are (permalink):

121, 242, 363, 484, 1001, 1111, 1221, 1331, 1441, 1551, 1661, 1771, 1881, 1991, 2002, 2112, 2222, 2332, 2442, 2552, 2662, 2772, 2882, 2992, 3003, 3333, 3663, 3993, 4004, 4224, 4444, 4664, 4884, 5005, 5115, 5225, 5335, 5445, 5555, 5665, 5775, 5885, 5995, 6006, 6336, 6666, 6996, 7007, 7777, 8008, 8448, 8888, 9009, 9999, 10021, 10131, 10241, 10351, 10461, 10571, 10681, 10791, 10901, 11011, 11121, 11231, 11341, 11451, 11561, 11671, 11781, 11891, 12001, 12111, 12221, 12331, 12441, 12551, 12661, 12771, 12881, 12991, 13101, 13211, 13321, 13431, 13541, 13651, 13761, 13871, 13981, 14091, 14201, 14311, 14421, 14531, 14641, 14751, 14861, 14971, 15081, 15191, 15301, 15411, 15521, 15631, 15741, 15851, 15961, 16071, 16181, 16291, 16401, 16511, 16621, 16731, 16841, 16951, 17061, 17171, 17281, 17391, 17501, 17611, 17721, 17831, 17941, 18051, 18161, 18271, 18381, 18491, 18601, 18711, 18821, 18931, 19041, 19151, 19261, 19371, 19481, 19591, 19701, 19811, 19921, 20042, 20152, 20262, 20372, 20482, 20592, 20702, 20812, 20922, 21032, 21142, 21252, 21362, 21472, 21582, 21692, 21802, 21912, 22022, 22132, 22242, 22352, 22462, 22572, 22682, 22792, 22902, 23012, 23122, 23232, 23342, 23452, 23562, 23672, 23782, 23892, 24002, 24112, 24222, 24332, 24442, 24552, 24662, 24772, 24882, 24992, 25102, 25212, 25322, 25432, 25542, 25652, 25762, 25872, 25982, 26092, 26202, 26312, 26422, 26532, 26642, 26752, 26862, 26972, 27082, 27192, 27302, 27412, 27522, 27632, 27742, 27852, 27962, 28072, 28182, 28292, 28402, 28512, 28622, 28732, 28842, 28952, 29062, 29172, 29282, 29392, 29502, 29612, 29722, 29832, 29942, 30063, 30393, 30723, 31053, 31383, 31713, 32043, 32373, 32703, 33033, 33363, 33693, 34023, 34353, 34683, 35013, 35343, 35673, 36003, 36333, 36663, 36993, 37323, 37653, 37983, 38313, 38643, 38973, 39303, 39633, 39963

For example, 39963 = 3 x 7 x 11 x 173 has first and last digits the same and 33 divides the number.

Monday, 28 October 2024

Number + SOD - POD Sequences

In this post, I will be using SOD as meaning the Sum Of Digits of a number and POD as meaning the Product Of Digits of a number. Consider a number like 27602 that is the number associated with my diurnal age today. What happens if I repeatedly add the sum of its digits and subtract the product of its digits? Because it contains the digit zero, its POD is initially 0 but this soon changes as I repeat the process. Here is the 27602's trajectory that consists of 26 steps (permalink):

276002, 276019, 276044, 276067, 276095, 276124, 275474, 267663, 258621, 257685, 240918, 240942, 240963, 240987, 241017, 241032, 241044, 241059, 241080, 241095, 241116, 241083, 241101, 241110, 241119, 241065, 241083

As can be seen, a loop is reached. What about 27610? Its trajectory consists of 27 steps (permalink):

27610, 27626, 26641, 26372, 25888, 20799, 20826, 20844, 20862, 20880, 20898, 20925, 20943, 20961, 20979, 21006, 21015, 21024, 21033, 21042, 21051, 21060, 21069, 21087, 21105, 21114, 21115

There is no loop here so why does the sequence terminate with 21115. The answer is that this number has a SOD (2 + 1 + 1 + 1 + 5 = 10) equal to its POD (2 x 1 x 1 x 1 x 5 = 10). So for every number, the corresponding sequence will have a finite number of steps ending in either a loop or a number with SOD = POD. 

What's of interest now are the progressive record lengths of the sequences as we consider larger and larger numbers. Table 1 shows the record lengths up to 110,000. 

Around 10,000 it can be seen that there is a big jump from 39 (9541) to 85 (9980) and again aroud 100,000 there is an even bigger jump from 98 (98907) to 631 (99970). If I were to continue there would be another big jump around one million. The sequence of numbers with record lengths is:

1, 10, 400, 417, 432, 482, 730, 2200, 2217, 2232, 2282, 2800, 2903, 3610, 4601, 5177, 6821, 7248, 9380, 9541, 9980, 9990, 10002, 98907, 99970, 99980, 99990, 100008

This sequence is not listed in the OEIS and I certainly won't be proposing it for inclusion. Variations on this theme are of course possible. For example, the product of digits could exclude the digit 0. This digit makes no difference to the sum of a number's digits but it has the effect of always sending the product of its digits to zero.

This makes a big difference to the sequence of record lengths and we no longer get those big jumps around 10,000, 100,000 and 1,000,000. Firstly though, let's go back to the original number 27601 and see how its trajectory is affected. The new trajectory is:

27601, 27533, 26923, 26297, 24811, 24763, 23777, 21745, 21484, 21247, 21151

The initial product of digits is now not zero but 2 x 7 x 6 x 1 = 84. The sum of its digits is still 16 but the SOD - POD now becomes 16 - 84 = -68 and so the next number in the sequence is 27533. The sequence ends with 21151 which has its SOD = POD.

The record lengths are shown in Table 2.


Table 2

The sequence of numbers with record lengths with zero not counting in the POD is now as follows:

1, 11, 100, 810, 1918, 1931, 2614, 2831, 2905, 3149, 3226, 3638, 3943, 4116, 4228, 4290, 4543, 6242, 7504, 7600, 7730, 8152, 8405, 9714, 19911, 23191, 23318, 23470, 25364, 27001, 29270, 44573, 45552, 46680, 47163, 47730, 49434, 54181, 54641, 55418, 56100, 57135, 71620, 73191, 73302, 74620, 75210, 78543, 81200, 82452, 83292, 87294, 88803, 95900, 97630, 98180, 100000, 100002

On the subject of numbers from 10 up to 100,000 in which SOD = POD, it is only these combination of digits that satisfy (permalink):

[2, 2], [1, 2, 3], [1, 1, 2, 4], [1, 1, 1, 2, 5], [1, 1, 1, 3, 3], [1, 1, 2, 2, 2]

There are 68 numbers in the range from 1 to 100,000 that satisfy SOD = POD and they are:

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 2141, 2411, 4112, 4121, 4211, 11125, 11133, 11152, 11215, 11222, 11251, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 12511, 13113, 13131, 13311, 15112, 15121, 15211, 21115, 21122, 21151, 21212, 21221, 21511, 22112, 22121, 22211, 25111, 31113, 31131, 31311, 33111, 51112, 51121, 51211, 52111

However, if we don't include zero in the product of digits then there are 164 numbers that qualify because we can insert zeros into all the above numbers with impunity. Of course this means that some numbers will exceed 100,000 and so will not be included in the list below (permalink).

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 22, 30, 40, 50, 60, 70, 80, 90, 123, 132, 202, 213, 220, 231, 312, 321, 1023, 1032, 1124, 1142, 1203, 1214, 1230, 1241, 1302, 1320, 1412, 1421, 2013, 2020, 2031, 2103, 2114, 2130, 2141, 2301, 2310, 2411, 3012, 3021, 3102, 3120, 3201, 3210, 4112, 4121, 4211, 10124, 10142, 10203, 10214, 10230, 10241, 10302, 10320, 10412, 10421, 11024, 11042, 11125, 11133, 11152, 11204, 11215, 11222, 11240, 11251, 11313, 11331, 11402, 11420, 11512, 11521, 12014, 12030, 12041, 12104, 12115, 12122, 12140, 12151, 12212, 12221, 12401, 12410, 12511, 13020, 13113, 13131, 13311, 14012, 14021, 14102, 14120, 14201, 14210, 15112, 15121, 15211, 20103, 20114, 20130, 20141, 20301, 20310, 20411, 21014, 21030, 21041, 21104, 21115, 21122, 21140, 21151, 21212, 21221, 21401, 21410, 21511, 22112, 22121, 22211, 23010, 24011, 24101, 24110, 25111, 30102, 30120, 30201, 30210, 31020, 31113, 31131, 31311, 32010, 33111, 40112, 40121, 40211, 41012, 41021, 41102, 41120, 41201, 41210, 42011, 42101, 42110, 51112, 51121, 51211, 52111

If we try reversing the order of the subtraction so that we have number + POD - SOD, the POD soon causes the sequences for many numbers to increase without bound. In the case of POD with zeros counted, the number 23 was the first to exceed a sequence length of 700. When zeros were not counted, 516 was the first number to exceed 700.