Sunday, 26 January 2025

Odd and Even Digit Averages

What do the following 98 numbers have in common (permalink)?

102, 123, 147, 234, 258, 306, 345, 369, 456, 567, 678, 789, 1012, 1034, 1056, 1078, 1223, 1245, 1267, 1289, 1447, 1469, 2334, 2356, 2378, 2558, 3036, 3058, 3445, 3467, 3489, 3669, 4556, 4578, 5667, 5689, 6778, 7889, 10004, 10022, 10036, 10112, 10167, 10234, 10356, 10478, 10667, 11125, 11233, 11247, 11459, 11477, 12223, 12278, 12345, 12467, 12589, 12778, 13349, 13457, 14447, 14555, 14569, 14677, 15699, 16779, 20238, 20346, 22236, 22344, 22358, 22588, 23334, 23389, 23456, 23578, 23889, 24568, 25558, 25666, 25788, 30048, 30066, 30336, 30444, 30458, 30566, 33347, 33455, 33469, 33699, 34445, 34567, 34689, 35679, 36669, 36777, 36899

First and foremost, all the numbers have their digits arranged in ascending order. Apart from that however, what else do they have in common? Let's look at the largest member of the sequence: 36899. It has odd digits of 3, 9, 9 and even digits of 6, 8. What are the averages of the odd and even digits? Well, (3 + 9 + 9)/3 = 7 and (6 + 8)/3 = 7 and so the average of the odd and even digits is the same. This is true of all the numbers. The reason that the digits have been arranged in ascending order is that these might be called "root" numbers because any number that is a permutation of the digits of the one of these numbers will have the property that its average of odd and even digits is the same.

In the range up to 40000, there are 1886 numbers that satisfy this equal average criterion. This comprises 4.71% of the range. Here is a permalink that will display these numbers. If we want to apply additional criteria, then this total of 1886 can be reduced significantly. For example, let’s require that the numbers be prime as well as the average of odd and even digits. The first such number would be 1223 which is prime and where the odd average is (1 + 3)/2 = 2 and the even average is (2 + 2)/2 = 2. There are 97 such numbers in the range up to 40000 (permalink):

1223, 1289, 2213, 2819, 2837, 3041, 3221, 3467, 4013, 4637, 4673, 4691, 5689, 5869, 6473, 6491, 7283, 7643, 7687, 7823, 7867, 8219, 8237, 8273, 8291, 8677, 9281, 9461, 10243, 11251, 12043, 12511, 12589, 14767, 15121, 15289, 15649, 16477, 16747, 17467, 17827, 20143, 20341, 20431, 21313, 21589, 21787, 21859, 22123, 23041, 23131, 23311, 23857, 23893, 24103, 25111, 25189, 25819, 25873, 25981, 27583, 27817, 28393, 28537, 28573, 28591, 28753, 28771, 28933, 29383, 29581, 29833, 29851, 30241, 31123, 31231, 31321, 32401, 32587, 32839, 32983, 33211, 33289, 33469, 33829, 34369, 34693, 34963, 36457, 36493, 36899, 36943, 38239, 38329, 38699, 38923, 39869

Neither of these two sequences is registered in the OEIS and I certainly won't be proposing them to the cretins who oversee it. However, the sequences are in my own private database. Here is the link. The averages themselves do not need to be integers. For example 3863503 has an odd average of (3 + 3 + 5 + 3)/3 = 14/3 and an even average of (8 + 6 + 0)/3 = 14/3. However, for all numbers in the range up to 40000, the averages are all integers.

Of course, we need not consider odd and even digits. We could consider the average of prime (2, 3, 5 and 7) and non-prime (0, 1, 4, 6, 8, 9) digits. An example of a number in which the average of the prime and non-prime digits is the same would be 39760 where (3 + 7)/2 = 5 and (9 + 6 + 0)/3 = 5. Here is a permalink to generate these numbers.

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$$

Thursday, 23 January 2025

Maximum Determinants

I fell to thinking as to what is the maximum determinant that can arise when the digits from 1 to 9 are entered into a 3 x 3 matrix. I came across this site that stated that the maximum determinant is 412. An example of a matrix with this maximum determinant is:$$ \text{det }\begin{bmatrix} 1 & 4 & 8 \\ 7 & 2 & 6 \\ 5 & 9 & 3 \end{bmatrix} = 412$$It turns out that there is an OEIS sequence that lists the maximum determinants for matrices up to 7 x 7. It is OEIS A085000 :


  A085000  Maximal determinant of an \(n \times n\) matrix using the integers \(1\) to \(n^2\).

The sequence begins: 1, 10, 412, 40800, 6839492, 1865999570, 762150368499

The 2 x 2 configurations are easy enough as there are only a total 24 possible configurations. One example of a 2 x 2 matrix with the maximum determinant of 10 is:$$ \text{det }\begin{bmatrix} 3 & 1 \\ 2 &4 \end{bmatrix} =10$$Before moving on to the higher 4 x 4, 5 x 5 etc. determinants, let's look at some maximum determinants where more constraints are imposed on a 3 x 3 matrix than simply entering the digits 1 to 9. For example, let's say we want the determinant to be a palindrome or a square or a cube or a prime. Here are examples of matrices that successively satisfy these additional criteria (source):$$ \begin{align} \text{det } \begin{bmatrix} 1 & 4 & 7 \\ 9 & 2 & 6 \\ 5 & 8 & 3 \end{bmatrix} &= 404 \\ \\ \text{det } \begin{bmatrix} 1 & 4 & 8 \\ 7 & 3 & 6 \\ 5 & 9 & 2 \end{bmatrix} &= 400 =20^2 \\ \\ \text{det } \begin{bmatrix} 1 & 4 & 6 \\ 8 & 3 & 5 \\ 7 & 9 & 2 \end{bmatrix} &= 343 = 7^3 \\ \\ \text{det } \begin{bmatrix} 1 & 4 & 9 \\ 8 & 3 & 6 \\ 5 & 7 & 2 \end{bmatrix} &= 389 \end{align} $$For 3 x 3 magic squares, the determinant is always 360. Here is an example of such a magic square matrix:$$ \text{det } \begin{bmatrix} 8 & 1 & 6 \\ 3 & 5 & 7 \\ 4 & 9 & 2 \end{bmatrix} = 360 $$As can be seen from the OEIS information, the maximum determinant of a 4 x 4 matrix is 40800. Here is an example of such a matrix:$$ \text{det } \begin{bmatrix} 16 & 6 & 4 & 9 \\  8 & 13 & 11 & 1 \\ 3 & 12 & 5 & 14 \\ 7 & 2 & 15 & 10 \end{bmatrix}= 40800 $$For a 5 x 5 matrix, the maximum determinant is 6839492. Here is an example of such a matrix (source):$$ \text{det } \begin{bmatrix} 25 & 15 & 9 & 11 & 4 \\ 7 & 24 & 14 & 3 & 17 \\ 6 & 12 & 23 & 20 & 5 \\ 10 & 13 & 2 & 22 & 19 \\ 16 & 1 & 18 & 8 & 21 \end{bmatrix} =6839492 $$ I won't display examples of the 6 x 6 and 7 x 7 matrices where the maximums are 1865999570 and 762150368499 respectively but I'll instead quote from the OEIS comments:

a(6) found with FORTRAN program given at Pfoertner link. A corresponding matrix is ((36 24 21 17 5 8) ( 3 35 25 15 23 11) (13 7 34 16 10 31) (14 22 2 33 12 28) (20 4 19 29 32 6) (26 18 9 1 30 27) ). - Hugo Pfoertner, Sep 23 2003

a(7) is the determinant of the matrix ((46 42 15 2 27 24 18) (9 48 36 30 7 14 31) (39 11 44 34 13 29 5) (26 22 17 41 47 1 21) (20 8 40 6 33 23 45) (4 28 19 25 38 49 12) (32 16 3 37 10 35 43)). Although no proof for the optimality of a(7) is available, the results of an extensive computational search make the existence of a better solution extremely unlikely. A total of approximately 15 CPU years on SGI Origin 3000 and of 3.8 CPU years on SGI Altix 3000 computers was used for this result.

Wednesday, 22 January 2025

A Special Complete Bipartite Graph

In December of 2024, I made a post titled Welcoming In 2025 in which I looked at some of the more interesting properties of the number 2025. Recently, in this YouTube video, I came across another interesting property of the number in connection to complete bipartite graphs and spanning trees.

The definition of a complete bipartite graph is a graph where all possible edges connect vertices in two disjoint sets, but no edge connects vertices in the same set. An example is \(K_{3,5} \) shown in Figure 1. The two disjoint sets have 3 and 5 vertices, hence the nomenclature.


A spanning tree is defined as a graph that connects all of a graph's vertices without creating any loops or cycles. It's a subgraph of the original graph, meaning it uses all of the vertices but only some of the edges.

An example of a spanning tree for \(K_{3,5}\) is shown in Figure 2 where the red edges represent the spanning tree.

There is a general formula for calculating the number of spanning trees for a \(K_{m.n} \) bipartite graph and it is:$$s(K_{3,5})=m^{n-1} n^{m-1}$$So in the case of \( K_{3,5} \) we have:$$s(K_{3,5})=3^4 5^2 = 2025$$Thus there are 2025 spanning trees for a complete \(K_{3,5}\) bipartite graph and thus we have another interesting property of this year's number.

Monday, 20 January 2025

Matrix Multiplication = Matrix Concatenation?

What are we to make of the following matrix multiplication like this. At first sight the multiplication looks straightforward enough:$$ \begin{bmatrix} 9 & 6 \\ 14 & 9 \end{bmatrix} \cdot \begin{bmatrix} 6 & 3 \\ 7 & 6 \end{bmatrix} = \begin{bmatrix} 96 & 63 \\ 147 & 96 \end{bmatrix} $$However, we then see that the same result could have been achieved by concatenation of corresponding elements because:$$\begin{bmatrix} 9 & 6 \\ 14 & 9 \end{bmatrix} \cdot \begin{bmatrix} 6 & 3 \\ 7 & 6 \end{bmatrix} = \begin{bmatrix} 9|6 & 6|3 \\ 14|7 & 9|6 \end{bmatrix} = \begin{bmatrix} 96 & 63 \\ 147 & 96 \end{bmatrix}$$ where the | symbol denotes concatenation. Obviously this is not what normally happens when one 2 x 2 matrix is multiplied by another, so what special conditions need to apply in order for this equivalence of multiplication and concatenation to take place?

An explanation is provided in this source and is shown in Figures 1 and 2:


Figure 1


Figure 2

When the two matrices being multiplied are the same, the matrix can be called a "vampire" matrix. For example:$$ \begin{bmatrix} 3 & 4 \\ 6 & 8 \end{bmatrix} \cdot \begin{bmatrix} 3 & 4 \\ 6 & 8 \end{bmatrix} =\begin{bmatrix} 33 & 44 \\ 66 & 88 \end{bmatrix}=11 \begin{bmatrix} 3 & 4 \\ 6 & 8 \end{bmatrix} $$Note that multiplying one matrix by itself is equivalent to multiplying by a scalar (11) which is one of the eigenvalues of the matrix (the other is 0). 11 is also the trace of the matrix since it is equal to the sum of its eigenvalues. In November of 2019, I made a post titled Eigenvalues and Eigenvectors that explains these concepts.

Wednesday, 15 January 2025

Collatz Trajectory Crossing Records

One of the properties associated with my diurnal age's number (27681) is that it is a member of OEIS A319738:


 A319738: Numbers whose Collatz trajectories cross their initial values a record number of times.

The initial members of the sequence are: 1, 3, 6, 9, 14, 18, 33, 54, 97, 129, 194, 257, 294, 313, 342, 353, 398, 417, 470, 626, 9225, 13739, 14473, 19297, 27681, 38881 (permalink)

Table 1 shows the progressive records (permalink):


Table 1

Figure 1 shows the Collatz trajectory of 27681 in which there are 61 crossings (permalink):


Figure 1

These record crossings are rather rare and I don't know if I'll experience the next one. I'll be 38881 days old which I'm unlikely to reach. The reason that I've never encountered these record number of crossings before is that the previous one occurred when I was 
19297 days old, long before I started this daily number analysis.

Saturday, 11 January 2025

Vampire Numbers

There is more than one type of vampire number but the first type that I'll deal with in this post belongs to OEIS A014575:


A014575
: Vampire numbers (definition 2): numbers \(n\) with an even number of digits which have a factorization \(n = i \times j\) where \(i\) and \(j\) have the same number of digits and the multiset of the digits of \(n\) coincides with the multiset of the digits of \(i\) and \(j\).

Examples are \(1260=21 \times 60\) and \(939658=953 \times 986\). The two relevant divisors of a vampire number are called its fangs and the numbers we are dealing with here have two fangs.

Up to one million, the vampire numbers are (permalink):

1260, 1395, 1435, 1530, 1827, 2187, 6880, 102510, 104260, 105210, 105264, 105750, 108135, 110758, 115672, 116725, 117067, 118440, 120600, 123354, 124483, 125248, 125433, 125460, 125460, 125500, 126027, 126846, 129640, 129775, 131242, 132430, 133245, 134725, 135828, 135837, 136525, 136948, 140350, 145314, 146137, 146952, 150300, 152608, 152685, 153436, 156240, 156289, 156915, 162976, 163944, 172822, 173250, 174370, 175329, 180225, 180297, 182250, 182650, 186624, 190260, 192150, 193257, 193945, 197725, 201852, 205785, 211896, 213466, 215860, 216733, 217638, 218488, 226498, 226872, 229648, 233896, 241564, 245182, 251896, 253750, 254740, 260338, 262984, 263074, 284598, 284760, 286416, 296320, 304717, 312475, 312975, 315594, 315900, 319059, 319536, 326452, 329346, 329656, 336550, 336960, 338296, 341653, 346968, 361989, 362992, 365638, 368550, 369189, 371893, 378400, 378418, 378450, 384912, 386415, 392566, 404968, 414895, 416650, 416988, 428980, 429664, 447916, 456840, 457600, 458640, 475380, 486720, 489159, 489955, 498550, 516879, 529672, 536539, 538650, 559188, 567648, 568750, 629680, 638950, 673920, 679500, 729688, 736695, 738468, 769792, 789250, 789525, 792585, 794088, 809919, 809964, 815958, 829696, 841995, 939658

As can be seen, \(1260\) is the first four digit vampire number and \(6880=80 \times 86\) is the last. The first six digit number is \(102510=201 \times 510\) and the last is \(939658\). Of the 156 numbers listed above, it can be seen that \(125460\) appears twice and this is because it has two representations viz. \(204 \times 615\) and \(246 \times 510\). 

\(13078260\) is an example of a vampire number that has three representations:$$ \begin{align} 13078260 &=1620 \times 8073\\&=1863 \times 7020 \\&=2070 \times 6318 \end{align}$$Wolfram Mathworld has examples of numbers that can be represented in four and five different ways.

Another type of vampire number is listed in OEIS A020342:


A020342: Vampire numbers: (definition 1): \(n\) has a nontrivial factorization using \(n\)'s digits. Nontrivial means that there must be at least two factors.

An example is \(126 = 6 \times 21\) and \(39784=8 \times 4973\). The initial members of this sequence are up to 40000 (permalink):

126, 153, 688, 1206, 1255, 1260, 1260, 1395, 1435, 1503, 1530, 1530, 1827, 2187, 3159, 3784, 6880, 6880, 10251, 10255, 10426, 10521, 10525, 10575, 11259, 11844, 11848, 12006, 12060, 12060, 12384, 12505, 12546, 12550, 12550, 12595, 12600, 12600, 12600, 12762, 12843, 12955, 12964, 13243, 13545, 13950, 13950, 14035, 14350, 14350, 15003, 15030, 15030, 15246, 15300, 15300, 15300, 15435, 15624, 15795, 16272, 17325, 17428, 17437, 17482, 18225, 18265, 18270, 18270, 19026, 19215, 21375, 21586, 21753, 21870, 21870, 25105, 25375, 25474, 25510, 28476, 29632, 31509, 31590, 31590, 33655, 33696, 36855, 37840, 37840, 37845, 39784

There are 712 numbers in the range up to one million, with some repeated numbers of course. All of the members of OEIS A014575 are in this sequence but the conditions (that the number must have an even number of digits and have its two divisors of equal length and not both ending in zero) have been relaxed. Consequently, any number \(n\) in the sequence will also have \(n \times 10\) in the sequence.