Saturday, 26 October 2019

The Smallest Parts Partition Function

Today I turned 25773 days old and I felt it shouldn't pass without making mention of this number's connection to the Smallest Parts Partition Function. This function assigns to each natural number \(n\), another number which is the total of the smallest parts in all partitions of \(n\). Here is the mapping, from \(n=1\) up to \(n=30\):

1, 3, 5, 10, 14, 26, 35, 57, 80, 119, 161, 238, 315, 440, 589, 801, 1048, 1407, 1820, 2399, 3087, 3998, 5092, 6545, 8263, 10486, 13165, 16562, 20630, 25773, ...

Figure 1 shows the SageMath code that I wrote to generate this sequence, up to and including 25773. Here is the Permalink.

Figure 1: SageMath code to generate
Smallest Parts Partition Numbers

Here is the example given in the OEIS A092269 comments:
Partitions of 4 are [1, 1, 1, 1], [1, 1, 2], [2, 2], [1, 3], [4]. 
1 appears four times in [1, 1, 1, 1]
1 appears two times in [1, 1, 2]
2 appears two times in [2, 2]
1 appears once in [1, 3]
4 appears once in [4]
Thus a(4)=4+2+2+1+1=10

Figure 2 shows a plot of the values up to 25773:

Figure 2: plot of the Smallest Parts Partition Function

Like the partition function, there is a generating function but it's rather complicated and I won't include it here. However, it can be viewed in the OEIS comments. I just wanted to mention it because the next member of the sequence is 31897 which is a long way off. There are a number of academic papers about this function so it is a topic of serious mathematical interest.

The number of partitions from 1 to 30 are shown in the list below:

[1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604]

It's interesting to look at the ratio between the total value of the number of smallest parts and the number of partitions for numbers between 1 and 30. The results and a plot of these values can be found in Figure 3.

Figure 3

Thursday, 10 October 2019

Totient and Sigma <--> Primes and Biprimes

Though it was obvious when I looked into it, I only recently realised that, for any prime number, the average of its totient and sum of divisors is equal to the number itself. This is because for a prime number \(p\), it's only divisors are itself and \(1\), thus the sum of divisors is \(p+1\). For the totient, the only number that is coprime with \(p\) is 1 and thus the totient is \(p-1\). Adding the sum of divisors and the totient together gives \(2p\) and the average is \(p\). Thus formally stated:


In a similar vein, it was only today that I discovered that for a number that is biprime, sometimes called semiprime, the average of its sum of divisors and totient is always one more than the number. Again, this was obvious once I looked into it. The reason is that a biprime number \(n\) has only two factors, let's say \(a\) and \(b\). Thus \(n=ab\). The sum of divisors is thus \(n+a+b+1\). For the totient, there are \(b-1\) multiples of \(a\) and \(a-1\) multiples of \(b\) that are coprime with \(n\). Thus the totient is \(n-a-b-1\), remembering that 1 is regarded as being coprime as well. Adding the sum of divisors and the totient together and averaging, we get:$$ \frac{(n+a+b+1)- (n-a-b-1)}{2}=\frac{2n+2}{2}=n+1$$This is all very simple stuff but I'd never seen this connection between the totients and sums of divisors of primes and biprimes formally stated before. Thus formally stated:


Thursday, 12 September 2019

An Algorithm

Figure 1
Algorithms seemingly rule the world. Today I was confronted with my number of the day (25729) and was struggling to find something of interest in it. All I came up with for my Twitter post is shown in Figure 1. Clearly I was clutching at straws but later I noticed an interesting pattern. 2 + 5 is 7 and 7 - 5 is 2 and 7 + 2 is 9. What's happening here can be represented as an algorithm:

ADD the 1st digit to the 2nd digit and put the result to the right of the two digits to form a new number (here the addition yields 7 and so the new number is 257).

SUBTRACT the 2nd digit from the 3rd digit and place the result to the right again to form a new number (here the result of the subtraction is 2 and so the new number is 2572).

ADD the 3rd digit to the 4th digit and place the result to the right again to form a new number (here the result of the addition is 9 and so the new number is 25729).

If this process were repeated two more times, the result would be 25729716. This leads to a problem because with 16 comes a jump in the number of digits. It's probably best to make the rule such that, if the result of the addition is a two digit number, then 10 is subtracted so that a one digit number is returned. This would yield 6 in the case of 16. The number is now 2572976.

Here again we have a problem because subtracting 7 from 6 yield -1. If we stick to our modulus 10 approach, then -1 is really 9. Thus the number becomes 25729769.

The algorithm is thus a repeating addition and subtraction of digit pairs, starting with the addition of the first two digits. What I did next was to investigate what happens to 25729769 as the process continues.

I found that once the digit stream reached 120 digits, the cycle was complete. This could be expressed in terms of a trajectory of length 120. I was interested in what happened with other pairs of starting digits.

There are 90 possibilities starting with 10 (I didn't want leading zeroes) and ending with 99.

Here is what I found (any numbers omitted have a trajectory of 120):

12 --> 24 digits before repeating
17 --> 24 digits before repeating
20 --> 40 digits before repeating
22 --> 40 digits before repeating
24 --> 8 digits before repeating
26 --> 40 digits before repeating
28 --> 40 digits before repeating
29 --> 24 digits before repeating
31 --> 24 digits before repeating
36 --> 24 digits before repeating
40 --> 40 digits before repeating
42 --> 40 digits before repeating
43 --> 24 digits before repeating
44 --> 40 digits before repeating
46 --> 40 digits before repeating
48 --> 8 digits before repeating
50 --> 3 digits before repeating
51 --> 3 digits before repeating
52 --> 3 digits before repeating
53 --> 3 digits before repeating
54 --> 3 digits before repeating
55 --> 3 digits before repeating
56 --> 3 digits before repeating
57 --> 3 digits before repeating
58 --> 3 digits before repeating
59 --> 3 digits before repeating
60 --> 40 digits before repeating
62 --> 8 digits before repeating
64 --> 40 digits before repeating
66 --> 40 digits before repeating
67 --> 24 digits before repeating
68 --> 40 digits before repeating
74 --> 24 digits before repeating
79 --> 24 digits before repeating
80 --> 40 digits before repeating
81 --> 24 digits before repeating
82 --> 40 digits before repeating
84 --> 40 digits before repeating
86 --> 8 digits before repeating
88 --> 40 digits before repeating
93 --> 24 digits before repeating
98 --> 24 digits before repeating

There are 90 numbers between 10 and 99:
  • 48 of them have trajectories of 120 digits
  • 42 of them have trajectories other than 120
Of these 42:
  • 10 have trajectories of 3 (50 to 59)
  • 4 have trajectories of 8 (24, 48, 62, 86)
  • 12 have trajectories of 24
    (12, 17, 29, 31, 36, 43, 67, 74, 79, 81, 93, 98)
  • 16 have trajectories of 40
    (20, 22, 26, 28, 40, 42, 44, 46, 60, 64, 66, 68, 80, 82, 84, 88)
The trajectories of 3, 8, 24 and 40 are all factors of 120 (3 x 40 = 120, 8 x 15 = 120, 24 x 5 = 120, 40 x 3 = 120)

Here is the SageMath code that I used (permalink):

a=2
b=5
number=[a,b]
for i in [1..65]:
    c=(a+b)%10
    number.append(c)
    d=(c-b)%10
    number.append(d)
    a=c
    b=d
string=""
for i in range(0,len(number)):
    string+=str(number[i])
print string 
item=str(number[0])+str(number[1])+str(number[2])
string2=''
for i in range(3,len(number)):
    string2+=str(number[i])
w=Word(string2)
print str(number[0])+str(number[1]),"-->",w.find(item)+3,"digits before repeating"

This produced an output of:

257297695615617637033033639659459439235275279219011011213253853813415495493473077077471451651671875835831891099099897857257297695615
25 --> 120 digits before repeating

The lesson to be drawn from this is that there is something of interest lurking in every number. It's up to us to see it. The fault is in ourselves, not the number. Notice also that the number 42 (the subject of my previous post) makes an appearance in this post (as the number of trajectories between 10 and 99 that are not equal to 120). The real mystery is why 120 is the upper limit and why there isn't a spread of trajectories rather than a clumping of them at 3, 8, 24, 40 and 120.

Monday, 9 September 2019

42

On April 1st 2019, my blog post was titled "42 is the new 33" and that time a solution to the problem of expressing 42 as a sum of three cubes had not been found. However, very recently, a solution was found as this Numberphile Video explains:


The solution is visible there in the thumbnail for the video but I'll repeat it below:$$X^3+Y^3+Z^3=42 \text{ when }$$ \(X = -80538738812075974\) 
\(Y = 80435758145817515\) 
\(Z = 12602123297335631\)

Certain numbers cannot be the sum of three cubes. The reason is that any cubic number must be equal to 0 or ±1 mod 9. If we add three cubic numbers together, the sum must therefore lie between -3 and +3 and so any number that is equal to 4 or 5 mod 9 (or equivalently ±4) cannot be expressed as a sum of three cubes. So between 1 and 99, the following numbers fall into this category: 4, 5, 13, 14, 22, 23, 31, 32, 40, 41, 49, 50, 58, 59, 67, 68, 76, 77, 85, 86, 94, 95.

It wasn't obvious to me why "any cubic number must be equal to 0 or ±1 mod 9". However, I finally realised why this was the case. Here is what I discovered:

Consider a number \(x\) that can be divided, by 9, \(n\) times leaving a remainder of \(r\). This means that \(x=9n +r\) and so \(x^3=(9n+r)^3 \). This latter expression becomes:$$(9n)^3+3 \times (9n)^2 r+ 3 \times (9n)r^2+r^3$$Clearly 9 divides each term of the above expression, except perhaps the \(r^3\) term. Because we are considering modulus 9, the remainder \(r\) must lie between -4 and +4 (-4 is the same as +5, -3 is the same as +6 etc.). Let's consider each possible remainder:
  • \(±4^3=±64\) and \(±64 \equiv ±1 \bmod 9\)
  • \(±3^3=±27\) and \(±27 \equiv 0 \bmod 9 \)
  • \(±2^3=±8\) and \(±8 \equiv ±1 \bmod 9\)
  • \(±1^3=±1\) and \(±1 \equiv ±1 \bmod 9 \)
  • \(0^3=0\) and \(0 \equiv 0 \bmod 9 \)
So there you have it, any cubic number must be equal to ±1 or 0 and so the sum of three cubes must lie between ±3. This excludes any number that is ±4 or ±5 mod 9.

Here are the numbers from 1 to 99 expressed as a sum of three cubes (zeroes allowed). The table was taken from an old site and I had to manually enter the values for 33, 42 and 74 because they were still empty:

Figure 1: numbers between 1 and 29
Figure 2: numbers between 30 and 64

Figure 3: numbers between 65 and 99

As the YouTube video makes clear, the search is on for a solution to 114, the next "unknown" after 42, but also for a third solution to 3. The two current solutions are \(1^3+1^3+1^3=4^3+4^3+(-5)^3=3\) but is there another solution? As yet, we don't know.

ADDENDUM: LINK

Well actually now we do know:$$ 3=569936821221962380720^{3}+(-569936821113563493509)^{3}+(-472715493453327032)^{3}$$The only remaining unsolved cases up to 1,000 are 114, 165, 390, 579, 627, 633, 732, 906, 921, and 975.

Sunday, 25 August 2019

The PrimeLatz Conjecture

The PrimeLatz Conjecture is so named in deference to and because of its similarity to the Collatz Conjecture that I've written about in earlier posts, namely:
The so-called Collatz Trajectory refers to the sequence of numbers generated by the following rule. Start with any positive integer. If the number is even, divide it by 2. If the number is odd, multiply by 3 and add 1. The conjecture is that the sequence of numbers thus generates will always lead to 1. So far, no exceptions have been found.

The PrimeLatz Trajectory is similar except that for odd numbers, the rule is to add the next three primes to the number. This will always generate an even number that is then divided by 2. The PrimeLatz Conjecture is that the sequence of numbers thus generated will always lead to a loop.

Take the case of 82. Here is the sequence:

82 41 184 92 46 23 120 60 30 15 74 37 168 84 42 21 104 52 26 13 72 36 18 9 50 25 122 61 272 136 68 34 17 88 44 22 11 60 ...

The sequence repeats after 11 is reached. Because 11 is odd, the next three primes are added. Thus 11 + 13 + 17 + 19 = 60 but 60 was reached earlier when 120 was divided by 2. Let's take another example, this time 84. The sequence is:

84 42 21 104 52 26 13 72 36 18 9 50 25 122 61 272 136 68 34 17 88 44 22 11 60 30 15 74 37 168 84 ...


Most numbers fall into a loop fairly quickly but what's of interest are those numbers that are more stubborn, such as 83. I deliberately chose numbers that were one above and one below 83 to emphasise the difference. Here is what the OEIS says about the behaviour of 83 where \(a(n)\) represents the sequence of terms:
Most small initial values have a very small orbit of few more than the 30 elements of the loop. 
N = 83 = a(0) is the most remarkable exception (having an orbit of 16180 + 30 elements), which motivates this sequence.  
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements, and N = 209 also has a comparatively large orbit of 941 + 30 elements, distinct from those of 83 and 443.
The initial value a(0) = 83 is odd, so we add to 83 the next 3 primes (89, 97 and 101) to get a(1) = 370. 
370 is even, so we divide by 2 to get a(2) = 185, and so on. 
After 8337 iterations, we get a(8337) = 10780054699424618132644155893087038044817868609971935265882538442720. 
This is the largest value we will reach. Since this is even we divide by 2 to get a(8338). The result a(8338) is again even, so we divide by 2 once more to get a(8339), and so on... 
After iteration 16171, we reach a(16171) = 768. The next 8 iterations consist in dividing by 2, until we get a(16179) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(16180) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we get again 26, and the sequence has become periodic.
All numbers less than 100 million eventually fall into the following loop:
9,50,25,122,61,272,136,68,34,17,88,44,22,11,60,
30,15,74,37,168,84,42,21,104,52,26,13,72,36,18

ADDENDUM 10th May 2020:

I'm now approaching my 26000th day on Earth and I've noticed that, in the orbit of 83, there is a cluster of numbers between 25000 and 31000 with wide gaps on either side. Figure 1 shows what I mean:

Figure 1

There is a gap of over 10000 from 15456 to 25710 and then a gap of over 20000 from 30912 to 51536. As I write this on the 10th May 2020, I'm 25970 days old and this number is in the 83 orbit. There are a total of 54 numbers that fall in the range from 25710 to 30912.

The full orbit of 83 can be viewed, in comma-delimited format, by following this link (it's 176 pages long):

https://docs.google.com/document/d/1uP-sBqDNjbhkEqK8IEDG-doN2QeYXnq0K8QObWkzPWU/edit?usp=sharing


Thursday, 22 August 2019

Binomial Transforms

My diurnal age today was 25706 and one of the properties of this number, as listed in the Online Encyclopaedia of Integer Sequences (OEIS), is that it belongs to OEIS A101509:  binomial transform of tau(n) (see A000005). Now \( \tau (n) \) is the divisor function and returns the number of divisors for any given number \(n\). OEIS A000005 gives the members of this sequence, beginning with \(n=1\):
1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, 2, 4, 4, 5, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 4, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 7, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 5, 4, 2, 12, 4, 4, 4, 8, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 8, ...
The binomial transform when applied to OEIS A000005 produces OEIS A101509:
1, 3, 7, 16, 35, 75, 159, 334, 696, 1442, 2976, 6123, 12562, 25706, 52492, 107014, 217877, 443061, 899957, 1826078, 3701783, 7498261, 15178255, 30706320, 62085915, 125465715, 253415981, 511608490, 1032427637, 2082680887, 4199956101, 8467124805, 17064784905, 34382825363, 69256687719, 139465867773, ...
As can be seen, the terms of the second sequence get large fairly quickly as each term in the first sequence is mapped an increasingly larger term in the second. In particular, the 13th term (2) in the first gets mapped to 25706 in the second. But what is a binomial transform?

To quote from Wikipedia:
In combinatorics, the binomial transform is a sequence transformation (i.e., a transform of a sequence) that computes its forward differences. It is closely related to the Euler transform, which is the result of applying the binomial transform to the sequence associated with its ordinary generating function.

The binomial transform, \(T\), of a sequence, {\(a_n\)}, is the sequence {\(s_n\)} defined by:$$s_n = \sum_{k=0}^n {n\choose k} a_k$$ 
Figure 1 shows some SageMath code that accepts the terms of a sequence as input and outputs the terms arising from the binomial transform of the input terms:

Figure 1: source

Figure 2 shows the above code applied to two different sequences, firstly the sequence of divisors of the natural numbers and then the sequence consisting only of 1's.

Figure 2

I'd like to find some practical applications of binomial transforms and also investigate the Euler transform in more depth.

Monday, 19 August 2019

Euler Bricks

Figure 1
Having posted several times about "sphenic bricks", I came across the term "euler bricks" today in the context of the number \( 25704 = 2^3 \times 3^3 \times 7 \times 17 \) which represents my diurnal age. Here is the entry in OEIS A031173 to which 25704 belongs:
Longest edge \(a \) of smallest (measured by the longest edge) primitive Euler bricks such that \( a \), \( b \), \(c\), \( \sqrt {a^2 + b^2}, \sqrt {b^2 + c^2}, \sqrt {a^2 + c^2}\) are all integers. 
240, 275, 693, 720, 792, 1155, 1584, 2340, 2640, 2992, 3120, 5984, 6325, 6336, 6688, 6732, 8160, 9120, 9405, 10725, 11220, 12075, 13860, 14560, 16800, 17472, 17748, 18560, 19305, 21476, 23760, 23760, 24684, 25704
Figure 1 shows the list of primitive numbers, up to 25704, with \(c<b<a\). In the case of 25704, the face diagonals are 31080, 17497, and 25721. Looking at Figure 1, it can be seen that there are five primitive Euler bricks with dimensions under 1000 and ten if primitive and non-primitive are included. It can be shown that if \(a\), \(b\) and \(c\) are the sides of an Euler brick then \(ka\), \(kb\) and \(kc\) with \(k\) any positive integer also form such a brick and interestingly, the sides \(ab\), \(bc\) and \(ac\) as well. The five primitive Euler bricks are depicted in Figure 2.


Figure 2: source

A perfect Euler brick is (to quote from Wikipedia):
An Euler brick whose space diagonal also has integer length. In other words, the following equation is added to the system of Diophantine equations defining an Euler brick:
\(a^{2}+b^{2}+c^{2}=g^{2}\) where \(g\) is the space diagonal. As of July 2019, no example of a perfect cuboid had been found and no one has proven that none exist.
Figure 3 illustrates this:

Figure 3: source
To quote again from Wikipedia:
An almost-perfect cuboid is defined as a cuboid that has 6 out of the 7 lengths as rational. Such cuboids can be sorted into three types, called Body, Edge, and Face cuboids. In the case of the Body cuboid, the body (space) diagonal \(g\) is irrational. For the Edge cuboid, one of the edges \(a\), \(b\), \(c\) is irrational. The Face cuboid has just one of the face diagonals \(d\), \(e\), \(f\) irrational. The Body cuboid is commonly referred to as the Euler cuboid in honor of Leonard Euler, who discussed this type of cuboid. He was also aware of Face cuboids, and provided the (104, 153, 672) example.
The smallest solutions for each type of almost-perfect cuboids, given as edges, face diagonals and the space diagonal (\(a, b, c, d, e, f, g\)):
  • Body cuboid: (44, 117, 240, 125, 244, 267, √73225)
  • Edge cuboid: (520, 576, √618849, 776, 943, 975, 1105)
  • Face cuboid: (104, 153, 672, 185, 680, √474993, 697)