Showing posts with label maximum. Show all posts
Showing posts with label maximum. Show all posts

Monday, 16 March 2026

There Can Be Only One 2

Let's recall the Fibonacci-like sequence from my previous blog post titled There Can Be Only One 1.

We start with a digit \(d\) between 0 and 9 and any integer \(s\) that does not contain \(d\). For example, 1 and 2 would be suitable. After that we begin the Fibonacci process using \(d\) and \(s\) as our seeds except that whenever a number appears containing one or more digits \(d\), they are all removed. 

In my previous post, I looked at three scenarios:

  • \(d=1\) and \(s=2\)
  • \(d=1\) and \(s=24\)
  • \(d=1\) and \(s=70\)
A major change occurs when we consider \(d=2\) as our "forbidden digit". Suddenly the 100 barrier can be breached as can be seen in Figure 1 where the sequence for \(d=2\) and \(s=1\) is depicted. Here the resulting sequence does not loop but exceeds the upper bound of 40000 that was set.


Figure 1: permalink

The sequence progresses like this:

[2, 1, 3, 4, 7, 11, 18, 9, 7, 16, 3, 19, 0, 19, 19, 38, 57, 95, 15, 110, 15, 15, 30, 45, 75, 10, 85, 95, 180, 75, 55, 130, 185, 315, 500, 815, 1315, 130, 1445, 1575, 300, 1875, 175, 50, 5, 55, 60, 115, 175, 90, 65, 155, 0, 155, 155, 310, ...

We can see that 155 + 155 = 310 jumps over the 200 barrier and from there it becomes seemingly unbounded (I tested up to ten million).

Not all values of \(s\) lead to unbounded sequences. For example, \(s=5\) leads quickly to a loop (see Figure 2): 

Starting Parameters: Forbidden Digit = 2, Second Number = 5

Max Value Limit: 40000
--------------------------------------------------
Resulting Sequence (17 terms):
[2, 5, 7, 1, 8, 9, 17, 6, 3, 9, 1, 10, 11, 1, 1, 0, 1]
--------------------------------------------------
Conclusion: The sequence entered a continuous loop.
The repeating pair that triggered the stop was: (0, 1)

Figure 2: permalink

Sequences are unbounded for \(s=1, 3, 4\) but loop for \(s=5, 6, 7, 8, 9, 10\) before becoming unbounded again for \(s=11\).

Saturday, 28 February 2026

Ups and Downs

My last post titled "The Path to Unity" focused on numbers that lead to zero when the recurrence shown in Figure 1 is applied:


Figure 1

Today, the number associated with my diurnal age (28090) leads to a sequence with wild gyrations but that eventually loops. Firstly though, the factorisation:$$28090=2 \times 5 \times 53^2$$The sequence has 164 members:

28090, 337080, 16179840, 112360, 2696640, 226517760, 73391754240, 67813980917760, 253895544556093440, 19590705598464, 6976747008, 3767443384320, 1453488960, 732558435840, 381540852, 82412824032, 95385213, 6867735336, 3296512961280, 1271802840, 488372290560, 308315840, 51797061120, 31078236672000, 72723073812480000, 6464273227776, 8144984266997760, 1414059768576, 1374466095055872, 4354308589137002496, 50161634946858268753920, 1209530163649167360, 69995958544512, 201588360608194560, 14284889498880, 3306687384, 1269767955456, 801621184, 134672358912, 80803415347200, 283619987868672000, 18757935705600, 60775711686144000, 4637951136000, 1431466400, 463795113600, 214719960, 61839348480, 80143795630080, 21405928320, 24775380, 4013611560, 7963515, 477810900, 1474725, 53090100, 11467461600, 15168600, 2184278400, 5056200, 546069600, 1685400, 121348800, 30579897600, 31460800, 3964060800, 2568711398400, 5340350997273600, 674286742080, 501701445, 63214382070, 27308613054240, 47189283357726720, 10923445221696, 10836751212, 2925922827240, 2738663766296640, 724514223888, 521650241199360, 172503386640, 113852235182400, 344289159191577600, 28980568955520, 66771230873518080, 12420243838080, 9952118460, 2149657587360, 3980847384, 573242023296, 192609319827456, 208018065413652480, 64203106609152, 63693558144, 221158188, 19904236920, 5732420232960, 4333709696117760, 9724844558088253440, 109229454076447262638080, 3010070934646364160, 307401034992480, 142315293978, 40986804665664, 48200482286820864, 260282604348832665600, 10299248351884800, 72300723430231296000, 2615043526845750, 9790722964510488000, 431689725066600, 2051389573516483200, 113061594660300, 46527405210, 25124798813400, 65123478524332800, 7444384833600, 21104831003256000, 1550913507000, 2679978540096000, 20260637763125760000, 577226147097600, 69411513600, 89957321625600, 24027062400, 27809100, 4505074200, 2270557396800, 1001127600, 2224728, 30899, 185394, 4449456, 400451040, 1112364, 60067656, 8649742464, 22525371, 946065582, 181644591744, 210236796, 45411147936, 70078932, 12614207760, 15016914, 1081217808, 259492273920, 266967360, 89701032960, 67955328, 353934, 12741624, 1528994880, 3033720, 291237120, 1078656, 22472, 269664, 9707904, 101124, 2730348, 50562, 2809, 8427, 50562

If we plot the sequence members, we get what is shown in Figure 2.


Figure 2

As can be seen, there are two massive spikes. The factorisations of both numbers are as follows:

  • \(50161634946858268753920 = 2^{23} \times 3^{11} \times 5 \times 7^5 \times 11 \times 13 \times 53^2\)
  • \(109229454076447262638080 = 2^{17} \times 3^{20} \times 5 \times 7 \times 11 \times 13 \times 17 \times 53^2\)

The associated number of divisors are:

  • \(50161634946858268753920\) has \(41472\) divisors
  • \(109229454076447262638080\) has \(36288\) divisors

These numbers of divisors of course divide into each of their respective numbers:

  • \( \dfrac{50161634946858268753920}{41472}=1209530163649167360\)
  • \( \dfrac{109229454076447262638080}{36288}=3010070934646364160\)
Figure 3 shows the trajectory plotted on a vertical logarithmic scales where the ups and downs are clearly visible and the difference in height between the the two spikes seems minor:


Figure 3: vertical logarithmic scale

The takeaway to all this is that, even though many sequences "blow up" under the rules imposed, some still manage to enter a loop despite having impressive spikes. Notice how the loop (50562, 2809, 8427, 50562) occurs:

  • \(50562 = 2 \times 3^2 \times 53^2 \text{ with }18 \text{ divisors} \)
  • \(2809 = 53^2 \text{ with } 3 \text{ divisors} \)
  • \(8427 = 3 \times 53^2 \text{ with } 6 \text{ divisors} \)
  • \(50562 = 2 \times 3^2 \times 53^2 \text{ with } 18 \text{ divisors}\)
\(2809\) is the minimum value reached and this is simply our original number (28090) divided by 10. Thus we have:$$ \frac{28090}{10}=2809 \text{ as the minimum value}$$Once again, the behaviour of the number 28090 (or any other number) under the above rules is INDEPENDENT of the number system being used.

Sunday, 8 February 2026

The Revision Revisited

In my post titled A Revision, I outlined an alternative algorithm for building a sequence based on the factors of numbers considered with multiplicity. This is the algorithm:

Suppose we take any positive integer \(n \gt 1\) and apply the following rules to it:
  • if a \(4k+1\) prime, double it and add 1: \(n \rightarrow 2n+1\)
  • if a \(4k+3\) prime, subtract 1 and divide by 2: \(n \rightarrow (n-1)/2\)
  • if composite, determine its number of factors \(f\) counted \( \textbf{with multiplicity}\)
    • if \( n \pmod f \equiv 0\) then \(n \rightarrow \dfrac{n}{f} \)
    • if \( n \pmod f \not\equiv 0 \) then \(n \rightarrow n \times f\)
Keep repeating this process until a loop is reached or call a stop after a fixed number of iterations. 

What I'm interested in looking at in this post are the record lengths of sequences generated over a range of numbers, noting as well the highest and lowest values that are reached by sequence members. Figure 1 shows the results in the range from one to one million (permalink):


Figure 1

Let's now consider the algorithm where multiplicity is ignored. This algorithm in as follows:

Suppose we take any positive integer \(n \gt 1\) and apply the following rules to it:
  • if a \(4k+1\) prime, double it and add 1: \(n \rightarrow 2n+1\)
  • if a \(4k+3\) prime, subtract 1 and divide by 2: \(n \rightarrow (n-1)/2\)
  • if composite, determine its number of factors \(f\) counted \( \textbf{without multiplicity}\)
    • if \( n \pmod f \equiv 0\) then \(n \rightarrow \dfrac{n}{f} \)
    • if \( n \pmod f \not\equiv 0 \) then \(n \rightarrow n \times f\)
Keep repeating this process until a loop is reached or call a stop after a fixed number of iterations. 

Figure 2 shows the record lengths, highs and lows for the range from one to one million (permalink).


Figure 2

It can be noted that the record lengths of sequences are shorter when multiplicity is ignored and more end in 1 rather than a loop.

Wednesday, 26 November 2025

Determinants of the 3 x 3 Matrix

Today's number, \( \textbf{27996} \) that defines my diurnal age has an interesting property that qualifies it for membership in OEIS A097401: Largest achievable determinant of a 3 x 3 matrix whose elements are 9 distinct nonnegative integers chosen from the range \( 0 \dots n\). In the case of 27996, \(n = 27\). The OEIS comments state that the configuration that achieves this largest value looks like this:$$ \begin{bmatrix} n & n-5 & 1 \\ 2 & n-1 & n-3 \\ n-4 & 0 & n-2 \end{bmatrix}$$The associated determinant is given by:$$ \begin{vmatrix} n & n-5 & 1 \\ 2 & n-1 & n-3 \\ n-4 & 0 & n-2 \end{vmatrix} = 2(n^3 - 9n^2 + 34n - 42) $$So in the case of \(n=27\) we have (permalink):$$ \begin{align} \begin{bmatrix} 27 & 22 & 1 \\ 2 & 26 & 24 \\ 23 & 0 & 25 \end{bmatrix} \rightarrow \begin{vmatrix} 27 & 22 & 1 \\ 2 & 26 & 24 \\ 23 & 0 & 25 \end{vmatrix}=27996 \end{align} $$Now the minimal value of \(n\) must be 8 in order to accommodate the nine digits from 0 to 8. This gives the following configuration for the maximum value of the determinant and if we add 1 to each entry we get the configuration for the digits from 1 to 9:$$ \begin{align} \begin{bmatrix} 8 & 3 & 1 \\ 2 & 7 & 5 \\ 4 & 0 & 6\end{bmatrix} \rightarrow \begin{vmatrix} 8 & 3 & 1 \\ 2 & 7 & 5 \\ 4 & 0 & 6 \end{vmatrix}=332 \\ \\  \begin{bmatrix} 9 & 4 & 2 \\ 3 & 8 & 6 \\ 5 & 1 & 7\end{bmatrix} \rightarrow \begin{vmatrix} 9 & 4 & 2 \\ 3 & 8 & 6 \\ 5 & 1 & 7 \end{vmatrix}=412 \end{align}$$Minimum values are easily determined because there is a fundamental property of matrices stating that swapping any two rows (or columns) reverses the sign of the determinant. So the minimal values of the determinants are just the negative values of the positive determinants. The members of OEIS A097401 are:

332, 528, 796, 1148, 1596, 2152, 2828, 3636, 4588, 5696, 6972, 8428, 10076, 11928, 13996, 16292, 18828, 21616, 24668, 27996, 31612, 35528, 39756, 44308, 49196, 54432, 60028, 65996, 72348, 79096, 86252, 93828, 101836, 110288, 119196, 128572

Gemini gives the following explanation of how this maximal configuration is arrived at:

The configuration of a $3 \times 3$ matrix using the digits 1 through 9 that yields the maximum determinant results in a value of 412.

Here is the optimal matrix configuration:

$$\begin{bmatrix} 9 & 4 & 2 \\ 3 & 8 & 6 \\ 5 & 1 & 7 \end{bmatrix}$$

How to Calculate the Determinant

To understand why this specific arrangement works, we can calculate the determinant using the Rule of Sarrus, which involves summing the products of the three downward diagonals and subtracting the products of the three upward diagonals.


1. The Positive Diagonals (Maximize these):

  • $9 \times 8 \times 7 = \mathbf{504}$

  • $4 \times 6 \times 5 = \mathbf{120}$

  • $2 \times 3 \times 1 = \mathbf{6}$

  • Sum of positives: $504 + 120 + 6 = \mathbf{630}$

2. The Negative Diagonals (Minimize these):

  • $2 \times 8 \times 5 = \mathbf{80}$

  • $4 \times 3 \times 7 = \mathbf{84}$

  • $9 \times 6 \times 1 = \mathbf{54}$

  • Sum of negatives: $80 + 84 + 54 = \mathbf{218}$

3. The Final Result:

$$\text{Determinant} = 630 - 218 = \mathbf{412}$$

The Strategy Behind the Solution

To achieve this maximum value, you cannot simply place numbers randomly. You must use a Grouping Strategy to exploit the math behind determinants:

  1. Group the Numbers: Divide the digits into three tiers:

    • Large: $\{9, 8, 7\}$

    • Medium: $\{6, 5, 4\}$

    • Small: $\{3, 2, 1\}$

  2. Maximize Positive Diagonals: You want the largest numbers to multiply each other.

    • We placed the Large group $(9, 8, 7)$ on the main diagonal to get the massive product of $504$.

    • We placed the Medium group $(6, 5, 4)$ on the next positive diagonal.

    • We sacrificed the Small group $(3, 2, 1)$ on the final positive diagonal.

  3. Minimize Negative Diagonals: You want to avoid large numbers multiplying each other in the reverse direction. By carefully rotating the positions of the Medium and Small numbers, we ensured that every negative diagonal consists of a "mixed" product (one Large, one Medium, and one Small number), preventing any single negative term from becoming too large.

GoalDeterminant ValueStrategy
Maximum412Maximize main diagonal products; minimize off-diagonal products.
Minimum-412Swap two rows of the Maximum matrix.
Smallest Magnitude0Use rows that are linearly dependent (e.g., $1,2,3$ and $4,5,6$ and $7,8,9$).
The configuration that produces the determinant closest to zero is the sequential order (or any arithmetic progression), which results in a determinant of 0.

If you specifically require a non-zero (non-singular) result, the minimum possible magnitude is 1.

Here are the configurations for both scenarios:

1. The Singular Solution (Determinant = 0)

This is the absolute closest you can get to zero.

$$\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$$

Why this happens:

In this matrix, the rows form an arithmetic progression (each number increases by 1).

  • Row 2 is just Row 1 with 3 added to every element.

  • Row 3 is just Row 2 with 3 added to every element.

    In linear algebra terms, these rows are linearly dependent. If you subtract Row 1 from Row 2, and Row 2 from Row 3, you get identical rows of $(3, 3, 3)$, which collapses the determinant to zero.


2. The Non-Singular Solution (Determinant $\approx 0$)

If you need the matrix to be invertible (non-zero determinant), you want to break the perfect symmetry of the zero-matrix just enough to get a value of 1 or -1 (or very close to it).

Here is a configuration that yields a determinant of -2:

$$\begin{bmatrix} 1 & 2 & 5 \\ 3 & 4 & 6 \\ 7 & 8 & 9 \end{bmatrix}$$

Calculation:

  • $1(36 - 48) - 2(27 - 42) + 5(24 - 28)$

  • $1(-12) - 2(-15) + 5(-4)$

  • $-12 + 30 - 20 = \mathbf{-2}$

(Note: It is possible to find arrangements that result in 1, but they are rare "needles in a haystack" among the 362,880 possible permutations. The value of -2 is an excellent example of a near-singular matrix.)

Summary Table

GoalDeterminantConfiguration Strategy
Absolute Closest0Use sequential numbers (1,2,3 / 4,5,6...) to create linear dependence.
Smallest Non-Zero$\pm$ 1 or 2Use the sequential matrix but swap one or two "Small" numbers with "Medium" ones to slightly break the pattern