Showing posts with label powers. Show all posts
Showing posts with label powers. Show all posts

Wednesday, 29 July 2026

28241: Analysis of an Interesting Number

My diurnal age today, 28241, has a number of interesting properties and a couple of them I've not met before. Let's examine them one by one.

FIRST INTERESTING PROPERTY

28241 can be formed by a concatenation of powers of 2 since all its digits are powers of 2 but the digits of its prime factors are all powers of 3:$$ \begin{align} 28241 & \equiv 2^1 \, || \, 2^3 \, || \, 2^1 \, || \, 2^2 \, || \, 2^0 \\ 28241 &= 31 \times 911 \\ &\equiv 3^1 \, || \, 3^0 \times 3^2 \, || \, 3^0 \, || \, 3^0 \end{align}$$In the range up to 40000, this doesn't happen often (ignoring 1 and 121 whose factors contain only the digits 1):$$ \begin{align} 81 &= 3^4  \\ 1441 &= 11 \times 131 \\1881 &= 3^2 \times 11 \times 19 \\ 21241 &= 11 \times 1931 \\ 28241 &= 31 \times 911 \end{align}$$SECOND INTERESTING PROPERTY

28241 is a member of OEIS A227942:


A227942: semiprimes formed by inserting a semiprime between the semiprime's ordered factors.

In the range up to 40000, only the following numbers qualify:

393, 2105, 2147, 3155, 5255, 5357, 25829, 26231, 28241, 29447, 33913, 35719, 39331$$ \begin{align} 3 \textbf{9} 3 &= 3 \times 131 \\ 2 \textbf{10} 5 &= 5 \times 421 \\ 2 \textbf{14} 7 &= 19 \times 113 \\ 3 \textbf{15} 5 &= 5 \times 631 \\ 5 \textbf{25} 5 &= 5 \times 1051 \\ 5 \textbf{35} 7 &= 11 \times 487 \\ 2 \textbf{58} 29 &= 23 \times 1123 \\ 2 \textbf{62} 31 &= 17 \times 1543 \\ 2 \textbf{82} 41 &= 31 \times 911 \\ 2 \textbf{94} 47 &= 11 \times 2677 \\ 3 \textbf{39} 13 &= 11 \times 3083 \\ 3 \textbf{57} 19 &= 23 \times 1553 \\ 3 \textbf{93} 31 &= 37 \times 1063 \end{align}$$THIRD INTERESTING PROPERTY

28241 is a member of OEIS A367337:


A367337: member of the commas sequence  starting with 5.


I'm familiar with the commas sequences and have written about them in a post titled The Commas Sequence in December of 2023. I won't show the full sequence but this snippet gives an idea of what's going on:$$ \dots, 28077, 28149, 28241, 28253, 28285, \dots $$Up to 40000, the remaining members of the sequence are:

28253, 28285, 28337, 28409, 28501, 28513, 28545, 28597, 28669, 28761, 28773, 28805, 28857, 28929, 29021, 29033, 29065, 29117, 29189, 29281, 29293, 29325, 29377, 29449, 29541, 29553, 29585, 29637, 29709, 29801, 29813, 29845, 29897, 29969, 30062, 30085, 30138, 30221, 30234, 30277, 30350, 30353, 30386, 30449, 30542, 30565, 30618, 30701, 30714, 30757, 30830, 30833, 30866, 30929, 31022, 31045, 31098, 31181, 31194, 31237, 31310, 31313, 31346, 31409, 31502, 31525, 31578, 31661, 31674, 31717, 31790, 31793, 31826, 31889, 31982, 32005, 32058, 32141, 32154, 32197, 32270, 32273, 32306, 32369, 32462, 32485, 32538, 32621, 32634, 32677, 32750, 32753, 32786, 32849, 32942, 32965, 33018, 33101, 33114, 33157, 33230, 33233, 33266, 33329, 33422, 33445, 33498, 33581, 33594, 33637, 33710, 33713, 33746, 33809, 33902, 33925, 33978, 34061, 34074, 34117, 34190, 34193, 34226, 34289, 34382, 34405, 34458, 34541, 34554, 34597, 34670, 34673, 34706, 34769, 34862, 34885, 34938, 35021, 35034, 35077, 35150, 35153, 35186, 35249, 35342, 35365, 35418, 35501, 35514, 35557, 35630, 35633, 35666, 35729, 35822, 35845, 35898, 35981, 35994, 36037, 36110, 36113, 36146, 36209, 36302, 36325, 36378, 36461, 36474, 36517, 36590, 36593, 36626, 36689, 36782, 36805, 36858, 36941, 36954, 36997, 37070, 37073, 37106, 37169, 37262, 37285, 37338, 37421, 37434, 37477, 37550, 37553, 37586, 37649, 37742, 37765, 37818, 37901, 37914, 37957, 38030, 38033, 38066, 38129, 38222, 38245, 38298, 38381, 38394, 38437, 38510, 38513, 38546, 38609, 38702, 38725, 38778, 38861, 38874, 38917, 38990, 38993, 39026, 39089, 39182, 39205, 39258, 39341, 39354, 39397

FOURTH INTERESTING PROPERTY

28241 has the property that:

  • sum of digits ( \(  \, \text{SOD}  \, \)  ) is prime: \(2 + 8 + 2 + 4 + 1 =17 \)

  • sum of digits squared (  \( \, \text{SOD}^2 \, \) ) is prime: \(2^2 + 8^2 + 2^2 + 4^2 + 1^2 =89 \)

  • sum of digits cubed ( \( \, \text{SOD}^3 \, \) ) is prime:  \(2^3 + 8^3 + 2^3 + 4^3 + 1^3 = 593 \)

This property is relatively common but nonetheless interesting.

Monday, 6 July 2026

Recurring Digital Invariant Variant (RDIV) Algorithm

Let's consider the following algorithm (formally called the Recurring Digital Invariant Variant or RDIV algorithm - see this link for an explanation of the name):

  • choose a number \(n\)
  • let \(k\) be the number of digits in \(n\)
  • raise each digit of \(n\) to the \(k\)-th power and add the results
  • call the new number \(n\) and repeat
Let's use \(n=14\) as an example:

  • \(14 \rightarrow 1^2 + 4^2 = 17\)
  • \(17 \rightarrow 1^2 + 7^2 = 50\)
  • \(50 \rightarrow 5^2 + 0^2 = 25\)
  • \(25 \rightarrow 2^2 + 5^2 = 29\)
  • \(29 \rightarrow 2^2 + 9^2 = 85\)
  • \(85 \rightarrow 8^2 + 5^2 = 89\)
  • \(89 \rightarrow 8^2 + 9^2 = 145\)
  • \(145 \rightarrow 1^3 + 4^3 + 5^3 = 190\)
  • \(190 \rightarrow 1^3 + 9^3 + 0^3 = 730\)
  • \(730 \rightarrow 7^3 + 3^3 + 0^3 = 370\)
  • \(370 \rightarrow 3^3 + 7^3 + 0^3 = 370\) 
370 is a narcissistic number as explained in my post Narcissistic, D-Powerfull and Friedman Numbers. The trajectory of any number under this algorithm will either end with a narcissistic number (as was the case with 14) or it will enter a loop (as is the case with 28218). The latter has the following trajectory (permalink):

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28218
==================================================
Full Trajectory Visited:

28218, 65601, 18678, 90120, 59082, 94974, 136953, 595181, 824837, 646826, 406272, 168529, 855931, 825565, 355739, 681798, 1220035, 80569, 102718, 379859, 1459029, 9660576, 6524445, 485466, 379273, 768261, 473170, 240124, 8321, 4194, 7074, 5058, 5346, 2258, 4753, 3363, 1539, 7268, 7809, 13058, 36137, 25070, 19964, 126899, 1371747, 2489202, 6896889, 16417266, 10869443, 61641187, 25966788, 86116067, 27580867, 47154531, 6683686, 5316235, 440689, 848433, 533938, 811397, 911965, 1125165, 436317, 169860, 886898, 1626673, 1665667, 2021413, 18829, 124618, 312962, 578955, 958109, 1340652, 376761, 329340, 537059, 681069 -> [loops back to 886898]

Loop Entry Point:   886898 (encountered at step 65)

Pre-period Length:  64 step(s) before entering cycle

Cycle Length:       14 distinct number(s) in the loop

Canonical Cycle:    18829, 124618, 312962, 578955, 958109, 1340652, 376761, 329340, 537059, 681069, 886898, 1626673, 1665667, 2021413

==================================================

Figure 1 shows a graph of its trajectory:

Figure 1: permalink

I've incorporated this algorithm into my daily number analysis.

Thursday, 14 August 2025

Energetic Numbers Revisited

In June of 2024, I posted about Energetic Numbers which are numbers that can be split into two or more parts and these parts, when raised to appropriate integer powers and added together, equal the original number. An example is 27476:$$ 27476 =27^3 + 4^6 + 7^4 + 6^4 $$In that post I made reference to a text file that listed the first 10000 energetic numbers but did not show how the numbers could be split and recombined.

Fortunately, I was able to get Gemini to create a SageMath program (permalink) that accomplishes this task whenever it is possible. I was prompted to attempt this because 27892, the number associated with my diurnal age today, is one of the numbers listed in the previously mentioned text file. For this number we have:$$27892=27^3 + 8 + 9 + 2^{13}$$Here is a list of some of the upcoming energetic numbers. Notice the run of consecutive numbers from 28260 to 28269 (permalink):

\(27892 = 27^3 + 8 + 9 + 2^{13}\) 
\(27923 = 2^{13} + 7^5 + 9^3 + 2^3 + 3^7\)
\(27962 = 27^3 + 9^2 + 6 + 2^{13}\)
\(27972 = 27^3 + 97 + 2^{13}\)
\(27984 = 2^9 + 7^5 + 9^4 + 8 + 4^6\)
\(28132 = 2^{12} + 8^4 + 1 + 3^9 + 2^8\)
\(28160 = 2^{11} + 8^3 + 160^2\)
\(28203 = 2^9 + 8 + 20^3 + 3^9\)
\(28224 = 28^3 + 2^{11} + 2^7 + 4^6\)
\(28228 = 2^{14} + 82^2 + 2^{10} + 8^4\)
\(28243 = 28^3 + 2^3 + 4^6 + 3^7\)
\(28245 = 2^{13} + 8^3 + 2^5 + 4^7 + 5^5\)
\(28260 = 2^{14} + 8^4 + 2^2 + 6^5 + 0\)
\(28261 = 2^{14 }+ 8^4 + 2^2 + 6^5 + 1\)
\(28262 = 2^{14 }+ 8^4 + 2^2 + 6^5 + 2\)
\(28263 = 2^{14} + 8^4 + 2^2 + 6^5 + 3\)
\(28264 = 2^{14 }+ 8^4 + 2^2 + 6^5 + 4\)
\(28265 = 2^{14 }+ 8^4 + 2^2 + 6^5 + 5\)
\(28266 = 2^{14} + 8^4 + 2^2 + 6^5 + 6\)
\(28267 = 2^{14} + 8^4 + 2^2 + 6^5 + 7\)
\(28268 = 2^{14} + 8^4 + 2^2 + 6^5 + 8\)
\(28269 = 2^{14} + 8^4 + 2^2 + 6^5 + 9\)

27892 also has the property that it can be split into two parts and the two parts, when added together, form a palindromic prime with a prime index:$$ \begin{align} 27892 &\rightarrow 27 + 892 \\  &=919          \\ &=\text{prime}(157) \end{align}$$

Friday, 24 January 2025

A Challenging Sequence

Here is a sequence that appeared in a 1926 SAT examination where participants had about twenty seconds on average to solve each question: $$750, 21, 264, 183,210, \dots, \dots$$Given the first five members of the sequence, one must find the next two members. At first there seems to be no pattern at all but the key to the solution is to look at the differences between the members of the sequence. 

With this insight, the solution is straightforward. Let's look at the differences between successive terms:$$\begin{align} 21- 750 &=-729\\ 264 -21 &= 243\\183-264 &= -81\\210-183 &= 27 \end{align}$$This gives the sequence:$$-729, 243, -81, 27=-3^6, +3^5, -3^4,+3^3$$Clearly the remaining differences are -3^2 and +3 and the sequence is then as shown in Figure 1:


Figure 1

In sequence notation we could express the successive terms using this formula:$$a_{n+1}=a_n + (-1)^{n+1} \cdot 3^{6-n} \text{ with }a_0=750$$The terms of this sequence will approach a limit of 203.25 (permalink). 

It's easy to generate other sequences using this approach. For example:$$100, 104, 95, 120, 56, \dots, \dots $$Once again, we are given the first five members of the sequence and must find the next two. Let's look at the differences:$$ \begin{align} 104 - 100 &= 4\\95-104 &=-9\\120-95 &=25\\56-120 &=-64 \end{align}$$These differences are all squares so let's write the difference in base index notation. We get:$$2^2, -3^2, 5^2, -8^2$$The bases (2, 3, 5 and 8) are Fibonacci numbers and so the progression must be \(13^2\) and \(-21^2\). The sequence is thus:$$100, 104, 95, 120, 56, 225, -216$$The absolute value of the terms of this sequence will increase without bound, alternating between positive and negative values. The formula for this sequence is (permalink):$$a_{n+1}=a_n + (-1)^n \cdot (\text{fibonacci}(n+3))^2 \text{ with } a_0=100$$The general formula for these types of sequences is:$$a_{n+1}=a_n+ \text{f}(n)$$The approach to finding missing terms is to find what \(\text{f}(n)\) is:$$f(n)=a_{n+1}-a_n$$The form of this function should emerge when considering the initial differences between the terms:$$ \text{f}(0), \text{f}(1),\text{f}(2),\text{f}(3), \dots$$

Tuesday, 12 November 2024

A Prime To Remember

My diurnal age today is 27617 and the second interesting property that I discovered about this number (my first being that it's prime) was the fact that:$$ \begin{align} 2^1+7^1+6^1+1^1+7^1 &= 23 \\2^2+7^2+6^2+1^2+7^2 &= 139 \\2^3+7^3+6^3+1^3+7^3 &= 911 \end{align}$$The sums of the digits raised to the first, second and third powers (23, 139 and 911) are all prime. Numbers with this property constitute OEIS A176179:


A176179
: primes such that the sum of digits, the sum of the squares of digits and the sum of 3rd powers of their digits is also a prime.

In the range up to 40,000, there are 322 numbers that are members of this sequence. They are:

11, 101, 113, 131, 199, 223, 311, 337, 353, 373, 449, 461, 463, 641, 643, 661, 733, 829, 883, 919, 991, 1013, 1031, 1103, 1301, 1439, 1451, 1471, 1493, 1499, 1697, 1741, 1949, 2089, 2111, 2203, 2333, 2441, 2557, 3011, 3037, 3307, 3323, 3347, 3491, 3583, 3637, 3659, 3673, 3853, 4049, 4111, 4139, 4241, 4337, 4373, 4391, 4409, 4421, 4481, 4603, 4663, 4733, 4919, 4931, 5303, 5503, 5527, 5639, 5693, 6043, 6197, 6337, 6359, 6373, 6719, 6733, 6791, 6917, 6971, 7411, 7433, 7691, 8209, 8353, 8803, 8887, 9091, 9109, 9341, 9413, 9419, 9431, 9491, 9901, 9941, 10099, 10103, 10141, 10211, 10301, 10499, 10909, 10949, 11003, 11047, 11113, 11117, 11131, 11159, 11171, 11173, 11243, 11261, 11311, 11317, 11399, 11423, 11443, 11489, 11519, 11621, 11731, 11777, 11821, 11939, 12011, 12101, 12143, 12161, 12211, 12347, 12413, 12437, 12451, 12473, 12541, 12583, 12611, 12743, 12853, 13001, 13049, 13171, 13241, 13313, 13331, 13339, 13421, 13441, 13487, 13711, 13933, 14011, 14051, 14071, 14107, 14143, 14251, 14321, 14327, 14341, 14387, 14431, 14543, 14549, 14723, 14783, 14891, 15241, 15401, 15443, 15823, 16097, 16361, 16631, 17041, 17401, 17483, 17609, 17627, 17977, 18121, 18149, 18211, 18253, 18523, 18743, 19009, 19139, 19319, 19333, 19391, 19403, 19777, 19841, 19913, 20023, 20089, 20333, 20441, 20809, 21011, 21101, 21121, 21143, 21211, 21341, 21347, 21611, 21767, 22003, 22027, 22111, 22229, 22447, 22481, 22483, 23417, 23581, 23741, 24113, 24137, 24151, 24247, 24281, 24317, 24371, 24443, 24821, 24977, 25057, 25183, 25253, 25411, 25453, 25523, 25583, 25589, 26111, 26177, 26399, 26717, 26993, 27143, 27431, 27479, 27527, 27617, 27749, 27947, 28111, 28351, 28513, 28559, 29989, 30011, 30307, 30323, 30347, 30367, 30491, 30637, 30703, 30763, 30853, 30941, 31247, 31333, 31393, 31847, 31991, 32141, 32303, 32411, 32969, 33023, 33113, 33203, 33311, 33331, 33353, 33391, 33533, 33863, 33931, 34019, 34127, 34141, 34211, 34217, 34439, 34703, 34721, 34781, 34871, 35069, 35083, 35281, 35803, 36037, 36073, 36161, 36299, 36307, 36383, 36389, 36697, 36833, 36929, 37003, 38053, 38639, 38693, 39041, 39119, 39133, 39191, 39313, 39443, 39667, 39863

However, 27617 has an even more exclusive claim to fame as shown below where the rightmost numbers represent digit sums. Here it is:$$ \begin{align}27617^1 &= 27617 \rightarrow 23 \\27617^2 &= 762698689 \rightarrow 61\\27617^3 &= 21063449694113 \rightarrow 53\\27617^4 &= 581709290202318721 \rightarrow 67\\27617^5 &=16065065467517436117857 \rightarrow 101\\27617^6 &=443668913016429033266856769 \rightarrow 127\\27617^7 &= 12252804370774720611730783389473 \rightarrow 131 \end{align}$$All the numbers on the right (23, 61, 53, 67, 101, 127 and 131) are prime. 27617 is the smallest prime with this property that qualifies it for membership in OEIS A131748:


A131748
: minimum prime that raised to the powers from 1 to \(n\) produces numbers whose sums of digits are also primes.

In the case of 27617, \(n=7\) and the initial members are: 2, 5, 739, 47, 4229, 2803, 27617, 142589, 108271, 2347283, 1108739, 300776929, 300776929, 14674550173, 92799126239

It would appear that 27617 is the only prime that is a member of both these OEIS sequences.

Friday, 28 April 2023

Rational Solutions to a^a = b^b

Here's a problem that I encountered on this site:

Find all pairs of rational numbers \((a,b)\) such that \(a^a=b^b\) for \(0 < a < b\).

One solution that was proposed runs as follows:

Write \(b=ax\) for some \(x>1\). Then \(x=b/a\) so \(x\) is rational.

Then taking logs, we get $$ \begin{align} a\log a&=b\log b\\&=ax\log(ax) \\ \log a&= x \log(ax) \\&=x \log(x)+x \log(a)      \\&=\frac{x\log x}{1-x} \\  a&=x^{\frac{x}{1-x}}\\b&=x^{\frac{1}{1-x}} \end{align} \\ \text{since } x\neq1 \text{ and } a\neq0$$Since \(x\) is rational, it suffices to find the values of \(x>1\) for which \(x^{\frac{1}{1-x}}\) is rational.

We claim that the only such values of \(x\) are \(x=\dfrac{n+1}{n}\) where \(n\) is an integer.

We may write \(x=1+\dfrac1n\) where \(n\in\mathbb{Q}\), \(n>0\).

It is easy to see if \(n\) is a positive integer that \(x^{\frac{1}{1-x}}\) is rational.

If \(n\) is not an integer, write \(n=p/q\) where \(p,q\in\mathbb{Z}^+\) are coprime with \(q>1\).

We have \(x^{\frac{1}{1-x}}=\left(\dfrac{n}{n+1}\right)^n=\left(\dfrac{p}{p+q}\right)^{p/q}\).

Hence \(p\) and \(p+q\) must be \(q \,\)th powers.

No two \(q \,\)th powers can differ by \(q\) since for positive integers \(u,v,q\), we have by the Binomial Theorem, $$(u+v)^q-u^q=qu^{q-1}v+\ldots+v^q>q\,.$$Therefore, if \(n\) is not an integer, \(x^{\frac{1}{1-x}}\) is not rational, so the only rational solutions are given by $$a=\left(\dfrac{n}{n+1}\right)^{n+1} \text{ and } \, b=\left(\dfrac{n}{n+1}\right)^n \text{ with } n\in\mathbb{Z}^+$$The initial values of \(a\) and \(b\) are shown in Figure 1.


Figure 1: permalink

Tuesday, 14 February 2023

Divisibility of Integers by their Totients

I got to thinking about the conditions for a number to be divisible by its totient. It didn't take too long to see the pattern. Figure 1 shows the results for numbers up to 1024.


Figure 1: permalink

Clearly condition is that the numbers must by of the form \(2^p. 3^q\) where \(p>0\) and \(q \geq 0\). There are only 35 numbers in this range and, if we extend the range to 10 million, there are still only 178 numbers that satisfy.

These numbers form OEIS A007694:


 A007694

Numbers \(k\) such that \( \phi(k) \) divides \(k\).   
          

The initial members of the sequence are:

1, 2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48, 54, 64, 72, 96, 108, 128, 144, 162, 192, 216, 256, 288, 324, 384, 432, 486, 512, 576, 648, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6912, 7776, 8192, 8748, 9216

The numbers must be even, that is they must contain a power of 2. If the numbers are only powers of 3 then the dividend is 1.5. Figure 2 shows the results in the range up to one million. All numbers are of the form \(3^p\) where \(p>0\).


Figure 2: permalink

What sort of numbers will produce a dividend of 2.5? Well, as it turns out, numbers of the form \(2^p.5^q\) where \(p>1\) and \(q>1\). See Figure 3 for the numbers in the range up to one thousand.


Figure 3: permalink

A dividend of 3.5 is produced by numbers of the from \(2^p.3^q.7^r \) where \(p>0\), \(q>0\) and \(r>0\). See Figure 4 for the numbers in the range up to one thousand.


Figure 4: permalink

Numbers involving 11 as a factor appear if the dividend is 2.2 where numbers are of the form \(2^p.11^q\) where \(p>0\) and \(q>0\). See Figure 5 where the range is up to ten thousand.


Figure 5: permalink

Numbers of the from \(2^p.11^q.23^q\) with \(p>0\), \(q>0\) and \(r>0\) produce a dividend of 2.3. See Figure 6 where the range is up to 100,000.


Figure 6: permalink

Numbers of the form \(2^p.3^q.31^r\) where \(p>0\), \(q>0\) and \(r>0\) produce a dividend of 3.1. Figure 7 shows the range up to ten thousand.


Figure 7: permalink

Numbers of the form \(2^p.3^q.11^r\) where \(p>0\), \(q>0\) and \(r>0\) produce a dividend of 3.3. See Figure 8 for numbers in the range up to one thousand.


Figure 8: permalink

More numbers emerge when we consider dividends like 3.25 and 3.75 but I'll stop there even though there is clearly room for further study of this topic. The following is a summary of what I found so far:
  • \( \dfrac{n}{\phi(n)}=k\) where \(k>0\) if numbers of form \(2^p.3^q\) with \(p>0\) and \(q \geq 0\)
  • \( \dfrac{n}{\phi(n)}=1.5\) if numbers of form  \(3^p\) with \(p>0\)
  • \( \dfrac{n}{\phi(n)}=2.2\) if numbers of form  \(2^p.11^q\) where \(p>0\) and \(q>0\)
  • \( \dfrac{n}{\phi(n)}=2.3\) if numbers of form \(2^p.11^q.23^q\) with \(p>0\), \(q>0\) and \(r>0\)
  • \( \dfrac{n}{\phi(n)}=2.5\) if numbers of form \(2^p.5^q\) with \(p>0\) and \(q>0\)
  • \( \dfrac{n}{\phi(n)}=3.1\) if numbers of form \(2^p.3^q.31^r\) where \(p>0\), \(q>0\) and \(r>0\)
  • \( \dfrac{n}{\phi(n)}=3.3\) if numbers of form \(2^p.3^q.11^r\) where \(p>0\), \(q>0\) and \(r>0\)
  • \( \dfrac{n}{\phi(n)}=3.5\) if numbers of form \(2^p.3^q.7^r \) with \(p>0\), \(q>0\) and \(r>0\)

Wednesday, 9 March 2022

Higher Order Odds and Evens Trajectory

My previous post on higher order Smith numbers gave me the idea to look into what happens with the odd and even trajectory of numbers when the squares of the digits are added or subtracted instead of just the digits themselves. The odd and even rule applied repeatedly to a number \(n\) is simply to add to \(n\) its odd digits and subtract its even ones. I've devoted numerous posts to the analysis of what happens beginning with my post titled Odds and Evens on June 17th 2021.

Numbers whose sum of odd and even digits is equal are not altered when this rule is applied. 112 is an example of such a number and numbers of this type I termed attractors. Other numbers follow a trajectory that either leads them to an attractor or else they enter a loop. Such a loop I termed a vortex and the numbers that comprise a vortex I termed vorticals. 

101 is an example of a number whose trajectory leads to an attractor, in this case 134. Here is its trajectory: 101, 103, 107, 115, 122, 119, 130, 134. 199 is an example of a number that enters a vortex. Its trajectory is 199, 218, 209, 216, 209. Here we see that {209, 216} is the vortex and the vorticals are 209 and 216. Numbers whose trajectories lead to attractors or vortices I've termed captives.

The purpose of this post is to explore what happens when, instead of adding just the odd digit or subtracting the even digit, we add higher powers of those digits. Let's begin by looking at what happens to the number associated with my diurnal age today viz. 26638. Under the odd and even rule, the trajectory is 26638, 26619, 26615, 26607, 26600, 26586, 26569. The trajectory leads to the attractor 26569 that has a total of 92 captives.

What if the squares of the digits are added and subtracted? Well the trajectory then becomes 26638, 26507, 26541, 26511, 26498, 26459, 26509, 26575, 26634, 26551, 26562, 26507 and it can be seen that the trajectory immediately enters a loop or vortex {26507, 26541, 26511, 26498, 26459, 26509, 26575, 26634, 26551, 26562}. 

Let's try with the cubes of the digits. In this case, we end up with an impressively long trajectory:

26638, 25713, 26201, 25970, 27159, 28349, 28521, 28119, 28330, 27864, 27407, 28021, 27494, 28430, 27873, 28066, 27114, 27387, 27580, 27528, 27468, 27011, 27348, 27134, 27433, 27758, 28049, 28194, 28340, 27783, 27976, 29167, 30016, 29828, 29517, 30707, 31420, 31376, 31558, 31324, 31307, 31705, 32201, 32213, 32252, 32380, 31914, 32608, 31899, 32873, 32750, 33237, 33653, 33643, 33444, 33306, 33171, 33570, 34092, 34776, 35209, 36082, 35373, 35922, 36787, 36772, 37261, 37408, 37202, 37556, 37960, 38843, 37809, 38396, 38451, 38028, 37023, 37412, 37711, 38426, 37653, 37959, 39912, 41390, 42083, 41526, 41364, 41048, 40409, 41010, 40948, 41037, 41344, 41180, 40606, 40110, 40048, 39408, 39588, 39445, 40198, 40352, 40432, 40323, 40305, 40393, 41112, 41043, 40943, 41571, 41977, 43329, 44040, 43848, 42723, 43013, 43004, 42903, 43587, 43506, 43378, 43199, 44621, 44270, 44477, 44971, 45916, 46491, 46877, 46771, 47178, 47289, 47777, 49085, 49363, 49866, 49587, 50208, 49813, 49994, 52053, 52322, 52450, 52628, 52009, 52855, 52710, 53171, 53668, 52876, 52608, 51997, 53924, 54733, 55191, 56172, 56417, 56606, 56083, 55507, 56225, 56243, 56107, 56360, 56080, 55477, 56349, 56950, 57713, 58552, 58407, 58299, 59362, 60019, 60533, 60496, 60729, 61577, 62173, 62320, 62115, 62018, 61283, 60575, 60952, 61582, 60972, 61820, 61085, 60483, 59718, 60404, 60060, 59628, 59746, 60663, 60042, 59754, 61012, 60790, 61646, 60935, 61600, 61169, 61468, 60461, 59966, 61117, 61247, 61303, 61142, 60856, 60037, 60191, 60706, 60617, 60529, 61159, 61799, 63385, 62836, 61911, 62427, 62474, 62465, 62086, 61134, 60883, 59670, 60651, 60345, 60217, 60337, 60518, 59916, 61284, 60485, 59818, 59649, 60952

As can be seen, the trajectory of 238 steps finally enters a loop or vortex {60952 ... 59649}. Figure 1 shows a plot of the trajectory.


Figure 1: permalink

When we try with fourth powers we find that the trajectory consists of 599 steps:

26638, 20015, 20625, 19922, 33013, 33257, 36429, 41503, 41954, 48629, 49526, 55144, 55883, 49022, 55295, 63715, 65527, 67866, 62283, 56940, 62574, 64032, 62545, 62227, 63284, 57701, 63129, 68460, 61516, 59551, 67988, 67462, 66999, 84090, 86299, 94013, 100400, 100145, 100516, 99847, 111018, 106926, 110880, 102690, 107940, 116647, 116202, 114876, 111631, 110420, 110150, 110778, 111486, 105841, 102116, 100807, 99113, 112318, 108290, 110740, 112887, 107082, 105372, 108464, 102561, 101876, 98887, 95561, 102077, 106864, 99921, 119589, 129242, 135500, 136832, 131587, 130600, 129386, 130621, 129392, 142564, 141366, 138601, 133292, 139984, 148836, 139174, 147963, 155455, 157700, 163128, 157803, 156815, 152675, 155015, 156892, 158671, 156307, 158119, 161212, 159887, 161283, 155958, 160299, 172110, 174498, 178853, 173769, 183918, 182370, 180741, 178792, 186044, 180141, 175792, 187765, 187801, 182012, 177886, 173201, 175669, 182665, 176587, 176623, 176498, 179813, 184762, 181500, 178031, 176419, 183831, 175803, 174815, 173491, 182280, 174057, 179229, 194721, 203413, 203304, 203194, 209565, 216064, 213201, 213252, 213911, 220540, 220877, 221551, 222771, 227526, 229208, 231625, 231004, 230814, 226528, 221713, 224165, 223207, 225641, 224683, 219084, 221278, 219536, 225492, 232374, 234649, 239467, 246942, 251663, 249762, 257140, 259895, 270155, 273791, 285220, 281701, 279992, 302044, 301597, 311266, 308741, 306872, 303946, 309117, 318162, 312837, 311289, 313821, 309873, 314901, 321289, 323804, 319598, 329331, 336120, 334971, 343840, 339394, 352503, 353899, 363712, 364964, 368502, 363800, 358570, 358206, 353504, 354660, 352518, 349738, 354510, 355586, 352150, 353466, 351405, 352481, 348820, 340437, 342488, 333849, 336301, 335249, 342325, 342824, 338265, 333644, 332079, 341187, 339319, 352685, 348608, 338945, 341941, 348073, 346284, 340445, 340383, 336274, 337269, 345081, 341436, 339791, 355477, 361354, 360590, 366561, 363380, 358231, 354907, 364319, 369491, 381143, 376955, 385952, 389732, 394744, 403019, 409406, 414159, 420835, 417173, 421802, 417419, 425871, 424530, 424708, 422485, 418470, 416264, 413145, 413341, 412993, 425925, 433448, 428746, 425227, 427949, 442944, 448465, 442930, 449044, 454581, 451224, 451306, 450461, 449279, 464274, 464595, 470598, 475833, 474669, 480527, 479185, 484421, 479542, 488601, 478858, 469340, 474174, 478209, 482803, 474420, 476037, 479368, 482763, 479581, 484817, 478515, 477815, 478891, 479406, 486560, 480241, 475618, 472997, 490649, 501963, 507935, 518228, 510630, 510041, 510412, 510767, 514899, 524295, 531818, 524334, 524593, 532213, 532969, 545485, 542752, 546115, 545815, 543339, 550512, 552372, 556072, 558411, 555311, 557269, 566169, 569468, 569710, 578002, 576916, 583912, 587068, 580606, 574543, 577763, 584376, 581835, 574975, 587332, 586408, 577289, 585165, 581649, 583188, 571607, 575739, 588433, 580772, 582087, 576905, 585821, 578864, 572146, 573605, 576041, 577516, 582273, 581252, 578375, 580412, 576670, 579505, 590342, 597337, 609487, 612801, 607395, 615767, 618603, 611997, 626226, 622290, 627507, 631622, 629080, 630233, 629164, 632862, 626223, 623664, 619585, 622005, 621302, 620056, 618073, 615164, 612943, 618018, 608532, 603830, 598600, 600394, 605484, 600205, 599518, 609795, 624647, 623928, 625146, 622908, 624045, 622846, 615870, 613505, 613541, 612697, 619052, 624927, 632305, 631780, 628871, 621769, 628124, 622445, 621230, 619984, 627459, 635478, 632937, 640749, 647903, 655394, 661734, 661369, 664124, 661005, 659039, 671571, 675704, 679579, 696832, 696770, 705541, 708937, 716285, 713904, 722692, 730310, 732874, 733389, 738498, 739093, 754778, 758254, 757537, 766071, 768282, 761163, 761055, 763411, 764343, 765098, 769293, 783585, 779125, 791098, 802526, 797727, 813876, 806871, 799785, 814238, 805856, 797618, 803590, 806761, 802475, 801133, 797201, 808549, 807287, 803881, 791675, 802368, 792945, 808821, 796518, 800714, 798764, 804479, 808833, 796707, 809175, 814667, 810125, 806640, 799696, 819188, 813463, 807978, 811149, 813361, 808133, 800104, 795753, 808447, 802144, 797521, 809494, 818008, 805721, 804636, 797773, 814019, 816230, 810904, 813114, 808846, 795006, 803297, 808228, 795908, 807960, 811530, 808142, 799679, 822868, 809252, 812310, 808281, 795978, 810431, 806162, 799459, 821912, 824347, 822205, 818686, 803807, 798097, 811925, 815001, 811532, 808128, 795825, 801925, 805000, 801529, 804604, 798700, 805967, 810162, 804756, 802134, 797848, 800763, 797853, 805826, 796947, 813319, 815948, 814687, 807345, 806100, 800709, 805575, 805755, 805935, 809731, 814679, 817994, 829166, 829024, 831201, 827172, 827847, 824185, 816347, 813182, 805057, 804612, 798949, 816681, 805899, 811454, 807473, 808004, 799556, 815033, 811725, 810641, 804995, 814390, 816681

Once again, a loop or vortex is entered {816681 ... 814390}. Figure 2 shows a plot of the trajectory.


Figure 2: permalink

With fifth powers, the trajectory is even longer (971 steps) and, as can be seen, the trajectory initially plunges into negative number territory.

26638, -21471, -37224, -53186, -16011, -8238, 57087, 61058, 23640, 15051, 21303, 21758, 8891, 2405, 4474, 18209, 44459, 103561, 99155, 223504, 225784, 211860, 171286, 147519, 225478, 211554, 216750, 228875, 183207, 167458, 145823, 115368, 78194, 120259, 182370, 166621, 143263, 134918, 160420, 151589, 184122, 150268, 112818, 47253, 66372, 67838, 11576, 23734, 39971, 175120, 195022, 257133, 277520, 314195, 375590, 457939, 595188, 594952, 718244, 700204, 715955, 801187, 752460, 763560, 768183, 711922, 787716, 797594, 951407, 1029365, 1083975, 1130432, 1129864, 1147315, 1166469, 1201168, 1160595, 1218120, 1185291, 1214668, 1165294, 1218638, 1145539, 1210059, 1272203, 1289158, 1285766, 1257347, 1293274, 1368286, 1287410, 1270395, 1349588, 1345446, 1337967, 1423341, 1421749, 1495527, 1576578, 1575899, 1684287, 1626727, 1644726, 1643902, 1694363, 1737323, 1771635, 1800843, 1734527, 1770454, 1805146, 1766705, 1787893, 1815264, 1776791, 1878487, 1812774, 1812566, 1767341, 1792400, 1867201, 1843434, 1808081, 1709779, 1878299, 1947637, 2031744, 2046715, 2057816, 2037173, 2071242, 2086930, 2105646, 2092164, 2142350, 2144631, 2135020, 2138325, 2109105, 2171249, 2246019, 2296205, 2350507, 2373775, 2427775, 2480233, 2446863, 2396706, 2457221, 2476034, 2483228, 2416815, 2378342, 2361779, 2446878, 2388293, 2382228, 2316807, 2293282, 2319678, 2355202, 2361599, 2475258, 2464459, 2515753, 2542147, 2559968, 2643740, 2650934, 2704519, 2782445, 2767497, 2868135, 2798160, 2833441, 2799080, 2901185, 2930561, 2985171, 3031354, 3034185, 3004005, 3006349, 3057084, 3043467, 3050936, 3105820, 3076389, 3112187, 3096440, 3145908, 3174534, 3192905, 3314340, 3313022, 3313688, 3241106, 3232519, 3295116, 3349727, 3441820, 3407216, 3415435, 3420124, 3418256, 3380025, 3350836, 3314146, 3304810, 3271505, 3294774, 3385600, 3348667, 3316616, 3293776, 3379117, 3472268, 3447686, 3414368, 3372263, 3381959, 3470901, 3545977, 3644109, 3693578, 3732501, 3752888, 3674727, 3716559, 3791133, 3867720, 3861001, 3820702, 3804920, 3830388, 3732813, 3717550, 3757658, 3757221, 3794140, 3868192, 3854141, 3822695, 3844504, 3812032, 3779687, 3848856, 3745120, 3764240, 3771434, 3803487, 3754220, 3773307, 3824457, 3809784, 3819323, 3846302, 3805188, 3710253, 3730640, 3739133, 3815962, 3837804, 3788537, 3760226, 3761660, 3755383, 3746401, 3753628, 3733470, 3766789, 3811375, 3799027, 3950950, 4075541, 4096551, 4153051, 4158522, 4130917, 4205994, 4325137, 4344500, 4344796, 4410047, 4423783, 4406228, 4363572, 4375158, 4364667, 4356341, 4350129, 4411491, 4467471, 4490238, 4514682, 4475184, 4459277, 4552985, 4587585, 4547207, 4581866, 4502880, 4439413, 4495877, 4556849, 4579556, 4655987, 4696525, 4745216, 4755293, 4836586, 4757842, 4759733, 4854983, 4849816, 4833506, 4795549, 4934656, 4979473, 5129380, 5158998, 5217811, 5204946, 5257264, 5271457, 5310266, 5298051, 5330551, 5340413, 5341977, 5436985, 5460959, 5576507, 5611720, 5623846, 5577838, 5552409, 5619777, 5724597, 5822454, 5793824, 5839224, 5867785, 5834337, 5821206, 5783724, 5786882, 5700702, 5737409, 5832416, 5794185, 5842500, 5814926, 5835501, 5812352, 5786014, 5764379, 5851610, 5817318, 5771959, 5929922, 6110098, 6128605, 6083379, 6119177, 6204067, 6204266, 6179850, 6218288, 6112145, 6106441, 6088843, 5981982, 6037638, 6006611, 5983285, 5983259, 6075050, 6090331, 6142091, 6192310, 6243796, 6303287, 6280004, 6238404, 6196023, 6239732, 6308234, 6267120, 6268312, 6220172, 6229108, 6247550, 6261775, 6282931, 6301616, 6278533, 6258375, 6241099, 6350366, 6330649, 6373608, 6342581, 6304350, 6299161, 6401677, 6418716, 6386181, 6305338, 6268648, 6178728, 6138999, 6275846, 6246402, 6228738, 6172412, 6180357, 6159989, 6299718, 6394048, 6410748, 6384964, 6393888, 6347343, 6355055, 6360022, 6344649, 6385317, 6365192, 6412026, 6395387, 6434310, 6424973, 6491216, 6533659, 6583892, 6572965, 6639487, 6666242, 6634050, 6620842, 6571434, 6581786, 6520631, 6508416, 6462198, 6471872, 6463887, 6398825, 6387898, 6357917, 6446173, 6445624, 6430093, 6480828, 6373692, 6434450, 6426970, 6486218, 6404075, 6414183, 6371836, 6340810, 6299486, 6368208, 6287331, 6264049, 6305466, 6284482, 6209058, 6230656, 6210664, 6186281, 6105163, 6092981, 6170504, 6181637, 6150369, 6197235, 6268652, 6215617, 6219967, 6339289, 6417297, 6501129, 6555497, 6631928, 6642869, 6644766, 6628421, 6579014, 6649196, 6742943, 6809186, 6787148, 6746427, 6762409, 6821657, 6793238, 6829004, 6846453, 6799453, 6928926, 6998640, 7067394, 7151500, 7174559, 7272449, 7363000, 7372517, 7426275, 7454150, 7475160, 7503100, 7523276, 7552418, 7541652, 7555878, 7533331, 7554236, 7568704, 7563875, 7563438, 7542288, 7495596, 7627951, 7715932, 7811932, 7855233, 7845976, 7900196, 8027326, 8003768, 7947506, 8034494, 8057946, 8095359, 8187182, 8105655, 8074487, 8040517, 8026658, 7948663, 7975418, 8037415, 8023799, 8126147, 8101356, 8064182, 7989815, 8062310, 8021978, 8032267, 8008709, 8019029, 8104328, 8037980, 8048543, 7984327, 8043409, 8067885, 7981737, 8058683, 7955971, 8113934, 8139679, 8234284, 8166879, 8161648, 8079538, 8093226, 8111910, 8138195, 8135078, 8089718, 8067271, 8060310, 8020010, 7987211, 8047076, 8039122, 8065583, 7998764, 8108908, 8069654, 8082484, 7982100, 8025157, 8015415, 7987875, 8034934, 8059653, 8084651, 8013441, 7978870, 8022804, 7956180, 7994618, 8087956, 8093625, 8115466, 8069249, 8145747, 8147671, 8139719, 8242101, 8208247, 8158430, 8095239, 8183905, 8180787, 8116098, 8101837, 8053353, 8027564, 8005896, 7994758, 8115803, 8053637, 8033511, 8004356, 7966156, 8021810, 7956244, 8025369, 8047210, 8030194, 8055695, 8083575, 8041339, 8067083, 8010821, 7945255, 8029430, 8054898, 8017744, 8016543, 7978344, 8036434, 7994328, 8095652, 8120375, 8107751, 8111724, 8094710, 8136775, 8133214, 8099878, 8136479, 8171011, 8155054, 8130638, 8057813, 8012453, 7981998, 8110417, 8093435, 8122303, 8089958, 8112877, 8080925, 8077531, 8081746, 8024218, 7957595, 8118682, 8012572, 7999673, 8202901, 8229119, 8314387, 8265121, 8227640, 8202815, 8140341, 8105770, 8109742, 8151775, 8158873, 8080745, 8034117, 8017377, 8035274, 8021625, 7984143, 8025427, 8011503, 7982105, 8028287, 7946726, 8022781, 7973989, 8152225, 8125612, 8088131, 7990072, 8141752, 8127862, 8071294, 8113327, 8097822, 8108078, 8026582, 7956331, 8028023, 7962666, 8007386, 7951124, 8029051, 8058426, 7987183, 8014554, 7985989, 8117532, 8104909, 8189216, 8174923, 8217199, 8319306, 8338298, 8299497, 8459627, 8497008, 8506304, 8468104, 8392745, 8438145, 8373930, 8417747, 8433353, 8403658, 8332690, 8351649, 8372499, 8473823, 8424524, 8391745, 8437178, 8404476, 8377667, 8380011, 8314720, 8297947, 8415835, 8355769, 8397574, 8459813, 8455671, 8437161, 8412645, 8373147, 8373456, 8352306, 8315341, 8285162, 8214912, 8240107, 8223091, 8249552, 8280995, 8336650, 8291941, 8376217, 8369499, 8505321, 8479015, 8524205, 8496599, 8635303, 8598613, 8587719, 8617972, 8670060, 8638547, 8584386, 8480650, 8409439, 8492964, 8568438, 8464702, 8438885, 8310157, 8297566, 8328195, 8325045, 8297714, 8356554, 8324604, 8282223, 8216802, 8143427, 8125630, 8088423, 7989306, 8083910, 8077667, 8079768, 8099119, 8243500, 8213044, 8178440, 8127664, 8095096, 8175775, 8199679, 8353090, 8382982, 8343906, 8361873, 8305855, 8249937, 8351261, 8314055, 8286757, 8250152, 8223571, 8210915, 8240291, 8265485, 8197367, 8249730, 8292005, 8321347, 8304817, 8255308, 8196233, 8215193, 8244812, 8177165, 8173362, 8150080, 8087670, 8047972, 8106811, 8033502, 8004313, 7971008, 8030904, 8056404, 8016937, 8052493, 8081086, 7975007, 8087602, 8031065, 7993890, 8155319, 8188095, 8151966, 8165822, 8095572, 8144878, 8061334, 8020253, 7990789, 8168782, 8079478, 8105581, 8046297, 8080553, 8021510, 7991837, 8111025, 8081353, 8019429, 8103704, 8086963, 8065167, 8036780, 7980518, 7993964, 8179361, 8214918, 8207377, 8225241, 8194479, 8294569, 8374192, 8416468, 8333333, 8302023, 8269677, 8313988, 8275220, 8262288, 8156112, 8118664, 8036554, 8001479, 8043544, 8011072, 7995081, 8100344, 8065772, 8061935, 8083809, 8044797, 8102644, 8060021, 8019446, 8035904, 8064529, 8085103, 8022936, 8041620, 8000021, 7967222, 8052013, 8022582, 7960075, 8048087, 7965566, 8024344, 7988715, 8018968, 7971938, 8091126, 8109601, 8128108, 8029774, 8088613, 7982777, 8076254, 8054586, 7986500, 8024937, 8067212, 8043412, 8008808, 7877736, 7904663, 7964186, 7990699, 8235926, 8257735, 8265042, 8226535, 8192420, 8217614, 8192823, 8186516, 8108555, 8052395, 8085137, 8039777, 8116722, 8092923, 8178432, 8128891, 8089606, 8067567, 8055986, 8047973, 8107087, 8075166, 8046779, 8097874, 8123977, 8184084, 8083733, 8035733, 8023626, 7975485, 8040606, 7991262, 8118328, 8020237, 8004455, 7975889, 8065190, 8086821, 7980710, 8040606

The trajectory once again enters a loop {8040606 ... 7980710}. Figure 3 shows the trajectory.



Figure 3: permalink

I'll leave off there and powers higher than 5 may prove rather unwieldy. It's not possible to make generalisations at this early stage but it would seem that the trajectories are far more volatile and lengthy once we start dealing with powers of digits. The trajectories may end up favouring vortices instead of attractors. 

One general observation is that the trajectories will always tend to rise rather than fall because there are the odd digits (1, 3, 5, 7 and 9) with an average value of 5 outweighing the even digits (0, 2, 4, 6, 8) with an average value of 4.

Thursday, 9 December 2021

Digit Sum Raised to Integer Powers

I'm familiar with what happens when the operation of sum of the digits squared is applied repeatedly to a number. Either the number 1 is reached or the loop {4, 16, 37, 58, 89, 145, 42, 20} is entered. Numbers that reach 1 are called happy numbers and I wrote about these in a blog post on June 26th 2018 titled Happy Numbers.

I hadn't considered what happens when the operation of digit sum squared is repeatedly applied. Let's highlight the difference between the two operations using my diurnal age of 26548 as an example.$$26548 \rightarrow 2^2+6^2+5^2+4^2+8^2=4+36+25+16+64=145\\26548 \rightarrow (2+6+5+4+8)^2=25^2=625$$In the case of the sum of the digits squared, it can be seen that continuing the operation leads to a loop because:$$145 \rightarrow 1^2+4^2+5^2=42$$However, in the case of the square of the digit sum, a loop is also entered because:$$625 \rightarrow (6+2+5)^2 = 169 \rightarrow (1+6+9)^2=256 \rightarrow (2+5+6)^2=169$$Nearly 45% of all numbers will enter this loop. Another 33% will end in 81. For example, 26547 follows this trajectory:$$26547 \rightarrow 576 \rightarrow 324 \rightarrow 81$$Another 22% will end in 1 and, in general, it seems that all numbers will either end in 1 or 81 or enter the loop {169, 256]. Here is a permalink to SageMathCell that will confirm this. The algorithm is easily modifiable to accommodate powers greater than 2 and so what happens if the digit sum is repeatedly raised to the third, fourth, fifth powers etc. can be investigated. Let's look next at the digit sum cubed.

What we find is that almost 32% of numbers enter the loop {6859, 21952}:$$6859 \rightarrow 28^3=21952 \rightarrow 19^3=6859$$All other numbers end in 1, 512, 4913, 5832, 17576 or 19683 with percentages of approximately 1.5%, 7.6%, 13.0%, 25.7%, 12.7% and 7.5% respectively:$$ \begin{align} 1 \rightarrow 1^3 &= 1\\512 \rightarrow 8^3 &= 512\\4913 \rightarrow 17^3 &= 4913\\5832 \rightarrow 18^3 &= 5832\\17576 \rightarrow 26^3 &= 17576\\19683 \rightarrow 27^3 &=19683 \end{align}$$When we raise the digit sum repeatedly to the fourth power, we find that again that some numbers enter the loop {104976, 531441}, about 33% in total:$$104976 \rightarrow 27^4= 531441 \rightarrow 18^4 = 104976$$All other numbers end in 1, 2401, 234256, 390625, 614656 or 1679616 with approximate percentages of 12.1%, 6.0%, 22.2%, 16.2%, 10.1% and 0.7% respectively:$$ \begin{align}1 \rightarrow 1^4 &= 1\\2401 \rightarrow 7^4 &= 2401\\234256 \rightarrow 22^4&= 234256\\ 390625 \rightarrow 25^4&= 390625\\614656 \rightarrow 28^4 &=614656\\ 1679616 \rightarrow 36^4 &=1679616 \end{align}$$When we raise the digit sum repeatedly to the fifth power, about 56% of numbers enter the loops {16807, 5153632, 9765625, 102400000} or {6436343, 20511149} or {28629151, 45435424}. All other numbers end in 1, 17210368, 52521875, 60466176 or 205962976 with approximate percentages of 1.0%, 4.3%, 11.1%, 33.3% and 5.8% respectively:$$ \begin{align}1 \rightarrow 1^5 &= 1\\17210368 \rightarrow 28^5 &= 17210368\\52521875 \rightarrow 35^5 &= 52521875\\60466176 \rightarrow 36^5&= 60466176\\205962976 \rightarrow 46^5 &=205962976\end{align}$$I could go on but the general pattern is clear.

Monday, 26 April 2021

Sum and Differences of Odd and Even Powers

Sometimes you need to go back to basics. I found that I was getting confused about the factorisation of general expressions like \(x^n+y^n \). 

SUM OF ODD AND EVEN POWERS

It turns out that if \(n\) is odd, then factorisation is possible according to the rule:$$a^{2n+1}+b^{2n+1}=(a+b)(a^{2n}-a^{2n-1}b+a^{2n-2}b^2- \dots - ab^{2n_1}+b^{2n} \text{ where }n \geq 1$$As an example, consider \(x^7+b^7 \) where$${x^7+b^7=\left(x^{6} - x^{5} y + x^{4} y^{2} - x^{3} y^{3} + x^{2} y^{4} - x y^{5} + y^{6}\right)} {\left(x + y\right)}$$I've seen it stated that \(x^n+y^n \) cannot be factored if \(n\) is even with \(x^2+y^2 \) and \(x^4+y^4\) cited as examples. See Figure 1.


Figure 1: source

This is certainly true for \(n=2\) and \(n=4\) and in fact in any power of 2 (8, 16, 32 etc.) but otherwise any composite number will contain an odd factor e.g. 6 = 2 x 3 and thus we can write \(x^6+y^6\) as \( (x^2)^3+(y^2)^3 \) and it is a sum of odd powers! In fact, it is a sum of two cubes:$$x^6+y^6={\left(x^{4} - x^{2} y^{2} + y^{4}\right)} {\left(x^{2} + y^{2}\right)}$$Now it might be thought that this is a special case, since any \(n\) that is a power of three can be written as a sum of two cubes. So let's consider \(x^{10}+y^{10}\). We jump over \(x^8+y^8\) because we know that it can't be factored. $$\ \begin{align} ( x^{10}+y^{10}&=(x^2)^5+(y^2)^5\\ &= {\left(x^{8} - x^{6} y^{2} + x^{4} y^{4} - x^{2} y^{6} + y^{8}\right)} {\left(x^{2} + y^{2}\right)} \end{align} $$In general, whatever \(m\) divides the even index to produce an odd number, then \(x^m+y^m\) will appear as a factor (this \(m\) must be a multiple of 2). For example, in the case of \(x^{48}+y^{48}\), \(x^{16}+y^{16}\) must be a factor.$$\begin{align} x^{48}+y^{48} &= (x^{16})^3+(y^{16})^3\\&={\left(x^{32} - x^{16} y^{16} + y^{32}\right)} {\left(x^{16} + y^{16}\right)} \end{align}$$DIFFERENCE OF ODD AND EVEN POWERS

In the case of \(x^n-y^n\), the factorisation is:$$x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+ \dots + xy^{n-2} + y^{n-1} \text{ for }n\geq 1$$If \(n \) is odd, then \(x-y\) is a factor and if \(n\) is even, then \(x-y\) and \(x+y\) are factors.$$\begin{align} x^7-y^7&={\left(x^{6} + x^{5} y + x^{4} y^{2} + x^{3} y^{3} + x^{2} y^{4} + x y^{5} + y^{6}\right)} {\left(x - y\right)}\\x^8-y^8&={\left(x^{4} + y^{4}\right)} {\left(x^{2} + y^{2}\right)} {\left(x + y\right)} {\left(x - y\right)} \end{align}$$IN CONCLUSION

  • \(x^n- y^n \) can always be factored
  • \(x^n+y^n\) can be factored provided \(n\) is not a power of 2.

Saturday, 21 November 2020

Personal Investigation: Part Four

This post builds on my three previous posts so it's best to look at those first in order to properly understand what I'm doing. These posts are:

It occurred to me that there's probably no reason to maintain \(k\) at a constant value and that the exponents could be variable. For example:$$a_n= \text{ sum of digits } \big (a_{n-1}^2+a_{n-2}^3+a_{n-3}^4\big ) \text { with }a_0=0, a_1=1,a_2=2$$Do we eventually end up in a loop? This is what I set out to investigate.

Let's start with the following SageMath code (permalink):

a, b, c= 0, 1, 2
L=[a, b, c]
for x in [1..31]:
    d=a^2+b^3+c^4
    d=sum(d.digits())
    L.append(d)
    a, b, c=b, c, d
print(L)

Here, instead of a single value for \(k\), the values are 2,3 and 4. The output of the algorithm reveals that, very quickly, a loop arises:
1, 2, 8, 10, 13, 24, 20, 32, 21, 30, 25, 25, 17, 33, 30, 28, 28, 29, 18, 18, 22, 13, 23, 21, 24, 25, 25, 26, 24, 39, 28, 28, 29

It would seem that, regardless of the starting values or the exponents, the series always ends up looping. For example, take starting values of \(a, b, c\)= 100, 191, 227 and exponents of 112, 223 and 454. Thus:$$a_n= \text{ sum of digits } \big (a_{n-1}^{112}+a_{n-2}^{223}+a_{n-3}^{454}\big ) \text { with }a_0=100, a_1=191,a_2=227$$Here the series reaches a maximum value 8328 and contains 275 distinct terms.

I've only explored the triad here but there's no reason to suppose that similar results hold true for the tetrad, pentad, hexad and beyond. It would seem that for constant powers, no matter how high, the series eventually repeats.

Tuesday, 17 November 2020

Personal Investigation: Part One

It is difficult to find a title for this post but as it certainly involves triads, or groups of three, I've settled on that. Let's start with the triad 0, 1, 2 and square each term so that we have:$$0^2+1^2+2^2=0+1+4 =5$$The result is 5 and, because it only contains one digit, the sum of its digits is 5. Now let's make 1, 2, 5 our new triad and carry out the same procedure:$$1^2+2^2+5^2=1+4+25=29 \text{ with sum of digits }=11$$If we continue this process, we get the following sequence of terms:

0, 1, 2, 5, 3, 11, 11, 8, 9, 14, 8, 8, 9, 11, 14, 20, 15, 11, 17, 14, 12, 17, 17, 11, 24, 23, 11, 11,15, 17,14, 8, 18, 17, 20, 5, 12, 20, 20, 17, 18, 5,17, 17, 9, 20, 14, 20, 24, 11,17, 23, 21, 17, 17, 11, ...

With the last three terms listed here, we have entered a loop because 17, 17, 11 appeared earlier. This is the loop:

17, 17, 11, 24, 23, 11, 11, 15, 17, 14, 8, 18, 17, 20, 5, 12, 20, 20, 17, 18, 5, 17, 17, 9, 20, 14, 20, 24, 11, 17, 23, 21

We find that there are only 17 numbers that appear, including our starting values of 0, 1 and 2. Here are the numbers expressed in order:

0, 1, 2, 3, 5, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24

What happens if we raise our triad of starting numbers to the third power. Here we have:$$0^3+1^3+2^3=0+1+8=9$$Once again, because 9 has only one digit, its sum of digits in also 9. Let's use 1, 2 and 9 as our new triad:$$1^3+2^3+9^3=1+8+729=738 \text{ with sum of digits }=18$$Continuing this process, we get the following sequence of terms:

0, 1, 2, 9, 18, 26, 17, 16, 26, 26, 26, 24, 34, 18, 28, 29, 18, 18, 17, 26, 16, 26, 26, ...

With the last three terms listed, we have again entered a loop because 16, 16 and 26 occurred earlier. Here is our loop:

16, 26, 26, 26, 24, 34, 18, 28, 29, 18, 18, 17, 26

We find that only twelve numbers appearing, including our starting values of 0, 1 and 2:

0, 1, 2, 9, 16, 17, 18, 24, 26, 28, 29, 34

If we continue raising our initial triads to higher and higher powers, it seems that we always get a finite set of numbers. In other words, sooner or later, a loop develops but must ensure to take enough terms. When raising to the 50th power for example, we must take at least 561 iterations and there are total of 106 terms. So what are we doing in general terms:$$a_n=\text{ sum of digits } \big (a_{n-1}^k+a_{n-2}^k+a_{n-3}^k \big )$$

where \(a_0=0, a_1=1 \text{ and }a_3=2, 2 \leq k \leq 50\)

For every value of \(k\), I've taken the largest value in the set of numbers generated and formed a sequence of these largest values for \(2 \leq k \leq 50\). Let's denote this term by \(a_{max, \, k}\) where \(k\) ranges from 2 to 50. The result is the following sequence:

[24, 34, 35, 58, 66, 93, 98, 99, 117, 140, 147, 165, 191, 181, 197, 218, 236, 248, 266, 297, 297, 311, 309, 347, 344, 362, 360, 408, 416, 436, 425, 449, 479, 482, 479, 544, 546, 546, 566, 570, 597, 624, 632, 702, 665, 664, 696, 710, 725]

We see that \(a_{max,\,4}=35\) and \(a_{max,\,49}=710\). The sequence more or less increases but not strictly so. I supposing that these loops (and consequent maximum values) continue for \(k >50\) but I haven't tested so far. The sequence is probably worthy of submission to the OEIS.

Sunday, 12 March 2017

Power Towers and Tetration

How is an expression like \(2^{{{2}^{2}}^{0}}\) evaluated? Such an expression is often termed a power tower and the convention is that the evaluation takes place from the top down so we have:

\(2^{{2}^{1}}=2^2=4\)

I saw this question posed in Quora and it evoked hundreds of responses.

The term used in this context is tetration which Wikipedia explains as follows:
In mathematics, tetration (or hyper-4) is the next hyper-operation after exponentiation, and is defined as iterated exponentiation. The word was coined by Reuben Louis Goodstein, from tetra-(four) and iteration. Tetration is used for the notation of very large numbers.  
The notation \({^{n}a}\) means \({a^{a^{\cdot^{\cdot^{a}}}}}\), the application of exponentiation \(n-1\) times.
Shown below are the first four hyperoperations, with tetration as the fourth:

Addition
\(a + n = a + \underbrace{1 + 1 + \cdots + 1}_n\)
\(n\) copies of 1 added to \(a\).

Multiplication
\(a \times n = \underbrace{a + a + \cdots + a}_n\)
\(n\) copies of \(a\) combined by addition.

Exponentiation
\(a^n = \underbrace{a \times a \times \cdots \times a}_n\)
\(n\) copies of \(a\) combined by multiplication.

Tetration
\({^{n}a} = \underbrace{a^{a^{\cdot^{\cdot^{a}}}}}_n\)
\(n\) copies of \(a\) combined by exponentiation, right-to-left.

Here is a proper definition:

For any positive real number \(a>0\) and non-negative integer \(n \ge 0 \), we define \(\,\! {^{n}a} \) by:$${^{n}a} := \begin{cases} 1 &\text{if }n=0 \\ a^{\left[^{(n-1)}a\right]} &\text{if }n>0 \end{cases} $$As we can see from the definition, when evaluating tetration expressed as an "exponentiation tower", the exponentiation is done at the deepest level first (in the notation, at the highest level). For example:$$\,\!\ ^{4}2 = 2^{2^{2^2}} = 2^{\left[2^{\left(2^2\right)}\right]} = 2^{\left(2^4\right)} = 2^{16} = 65,\!536$$Note that exponentiation is not associative, so evaluating the expression in the other order will lead to a different answer:$$\,\! 2^{2^{2^2}} \ne \left[{\left(2^2\right)}^2\right]^2 = 2^{2 \cdot 2 \cdot2} = 256$$Exponential towers must be evaluated from top to bottom (or right to left). Computer programmers refer to this choice as right-associative.

Source: https://en.wikipedia.org/wiki/Tetration 

Note: there's nothing very original about this post. I've copied the rather involved LaTeX code from the Wikipedia editing page, modified it by getting rid of the maths arrow brackets and replaced them with \( signs. I was mainly interested to see how the LaTeX would convert and as it turned out the transfer from Wikipedia to Blogger was quite straightforward.