Processing math: 100%

Friday, 31 January 2025

Building Block Numbers

The prime numbers are considered the building blocks of the positive integers because every composite number can be expressed as a product of prime numbers. However, the OEIS A086424 offers an alternative set of building blocks:


A086424 Numbers needed to generate all other natural numbers, only allowing multiplication and addition. Each number can be used only once.


These numbers are: 

1, 2, 4, 11, 25, 64, 171, 569, 3406, 27697, 243374, 1759619, 28381401, 222323189, 3416307938, 26838745347

Here is an extract from the OEIS comments:
  • 10 is not in the sequence because (4+1)*2 = 10.
  • 11 is in the sequence because there is no way to get 11 by using the earlier terms.
  • 509 is not in the sequence because
    509 = (1+25)*(2+11)+171.
The number associated with my diurnal age today is 27697 and this is the first number that cannot be expressed in terms of the numbers 1, 2, 4, 11, 25, 64, 171, 569 and 3406 using only multiplication or addition and using each number only once. From now on, up to but not including 243374, every number can be expressed in terms of 1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697. This is a big deal.

GEMINI WAS ABLE TO CHANGE PARI CODE
TO PYTHON AFTER A FEW TRIES

The OEIS comments offer some PARI code to generate this list of numbers and, after many errors on the part of Gemini, I was able to get to produce some working PYTHON code that will do the same job, albeit slowly. Here is the code:

from sage.all import *

def Ww(v):
    """
    Calculates the Ww function for a given list of integers.
    Args:
        v: A list of integers.
    Returns:
        A list of integers resulting from the Ww function.
    """
    if len(v) == 2:
        return [v[0], v[1], v[0] + v[1], v[0] * v[1]]
    else:
        V = []
        for i in range(len(v)):
            for j in range(i + 1, len(v)):
                t = v[:i] + v[i+1:j] + v[j+1:]
                if t:
                    V.extend(Ww(t + [v[i] + v[j]]))
                    V.extend(Ww(t + [v[i] * v[j]]))
        return sorted(set(V))  # Remove duplicates
a = [Integer(1), Integer(2), Integer(4)]
for n in range(3, 10):
    V = Ww(a)
    for i in range(2 * a[-1], len(V) + 1):
        if V[i - 1] > i:
            a.append(i)
            print(f"a = {a}")
            break
    else:
        print(f"No solution found for n = {n}")  
 

EVERY NUMBER UP TO BUT NOT INCLUDING 27697
CAN BE EXPRESSED IN TERMS OF
1, 2, 4, 11, 25, 64, 171, 569 and 3406
USING ONLY ADDITION AND MULTIPLICATION
AND USING ONE NUMBER ONLY ONCE

Of course the execution of this code on SageMathCell will quickly time out and it will only generate the numbers up to 171. However, running it in a Jupyter notebook on an M1 Macbook Air, it will generate the numbers up to 3406 fairly quickly but after an hour or so it never got to 27697 so I stopped it. 

I asked Gemini to come up with an algorithm in Python to express a given number in terms of these new "building blocks" but it consistently failed so I gave up. However, it will be easy initially for numbers greater than 27697. For example:

  • 27698 = 27697 + 1
  • 27699 = 27697 + 2
  • 27700 = 27697 + 2 + 1
  • 27701 = 27697 + 4 etc.

I'll continue to do this as an exercise associated with my daily number analysis. Figure 1 shows an analysis of the building block numbers and their factors. It can be seen that the only prime numbers are 2, 11, 569 and 27697. It should be noted that the property these numbers have collectively is NOT base dependent.

Figure 1

These particular building blocks are remarkably economical considering how many unique primes we would require to "build" all the numbers from 2 to 27697. It is in fact 3020. These blocks only require nine blocks: 1, 2, 4, 11, 25, 64, 171, 569 and 3406. They become even more economical for larger numbers. For example in the range up to 243373 (one less than 243374), we require 21494 unique primes but only ten of our new building blocks: 1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697. However, unlike the prime building blocks, representations using these new building blocks are not unique. For example, 12 can be represented as 11 + 1 or (1 + 2) * 4. Remember, bracketing is allowed.

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 386350 has an odd average of (3 + 3 + 5)/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,,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:21750=72926421=243183264=81210183=27This gives the sequence:729,243,81,27=36,+35,34,+33Clearly 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:an+1=an+(1)n+136n with a0=750The 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,,Once again, we are given the first five members of the sequence and must find the next two. Let's look at the differences:104100=495104=912095=2556120=64These differences are all squares so let's write the difference in base index notation. We get:22,32,52,82The bases (2, 3, 5 and 8) are Fibonacci numbers and so the progression must be 132 and 212. The sequence is thus:100,104,95,120,56,225,216The 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):an+1=an+(1)n(fibonacci(n+3))2 with a0=100The general formula for these types of sequences is:an+1=an+f(n)The approach to finding missing terms is to find what f(n) is:f(n)=an+1anThe form of this function should emerge when considering the initial differences between the terms:f(0),f(1),f(2),f(3),

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:det [148726593]=412It 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×n matrix using the integers 1 to n2.

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:det [3124]=10Before 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):det [147926583]=404det [148736592]=400=202det [146835792]=343=73det [149836572]=389For 3 x 3 magic squares, the determinant is always 360. Here is an example of such a magic square matrix:det [816357492]=360As 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:det [16649813111312514721510]=40800For a 5 x 5 matrix, the maximum determinant is 6839492. Here is an example of such a matrix (source):det [25159114724143176122320510132221916118821]=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 K3,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 K3,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 Km.n bipartite graph and it is:s(K3,5)=mn1nm1So in the case of K3,5 we have:s(K3,5)=3452=2025Thus there are 2025 spanning trees for a complete K3,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:[96149][6376]=[966314796]However, we then see that the same result could have been achieved by concatenation of corresponding elements because:[96149][6376]=[9|66|314|79|6]=[966314796] 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:[3468][3468]=[33446688]=11[3468]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:


 A319738Numbers 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×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×60 and 939658=953×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×86 is the last. The first six digit number is 102510=201×510 and the last is 939658Of the 156 numbers listed above, it can be seen that 125460 appears twice and this is because it has two representations viz. 204×615 and 246×510. 

13078260 is an example of a vampire number that has three representations:13078260=1620×8073=1863×7020=2070×6318Wolfram 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:


A020342Vampire 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×21 and 39784=8×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×10 in the sequence.

Thursday, 9 January 2025

Aliquant Parts

I came across a mathematical term today that I hadn't heard of before. The term is "aliquant" defined as follows by contrasting it to similar sounding "aliquot" (source):

Webster defines 'aliquot' as something that contained an exact number of times in something else or to divide into equal parts.

Notice the word "equal". An example being 5 is an aliquot part of 15.

The term 'aliquant', however, is slightly different. Defined as being a part of a number or quantity, but not dividing it without leaving a remainder. An example being 5 is an aliquant part of 16. 

The term occurred in the following context:


 
A098743: number of partitions of n into aliquant parts (i.e., parts that do not divide n). 

The initial members of the sequence are:

1, 0, 0, 0, 0, 1, 0, 3, 1, 3, 3, 13, 1, 23, 10, 11, 9, 65, 8, 104, 14, 56, 66, 252, 10, 245, 147, 206, 77, 846, 35, 1237, 166, 649, 634, 1078, 60, 3659, 1244, 1850, 236, 7244, 299, 10086, 1228, 1858, 4421, 19195, 243, 17660, 3244, 12268, 4039, 48341, 1819, 27675

The last member shown above, 27675, is my diurnal age today and corresponds to n=55. To find the aliquant parts, simply remove the divisors of the number. For example, 55 has divisors of 1, 5, 11 and 55 and so the number of aliquant parts is 51. The list is as follows:

2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54

Note that these are different to the numbers that contribute to the total of the totient of a number, where the numbers are coprime. The totient for 55 is 40, made up of the following numbers.

1, 2, 3, 4, 6, 7, 8, 9, 12, 13, 14, 16, 17, 18, 19, 21, 23, 24, 26, 27, 28, 29, 31, 32, 34, 36, 37, 38, 39, 41, 42, 43, 46, 47, 48, 49, 51, 52, 53, 54