Showing posts with label mertens. Show all posts
Showing posts with label mertens. Show all posts

Wednesday, 17 September 2025

Some Interesting Properties of 39

My daughter-in-law turned 39 yesterday and so I was prompted to investigate some of its mathematical properties. One of its properties is its membership in OEIS A055233:


A055233: composite numbers equal to the sum of the primes from their smallest prime factor to their largest prime factor.

The only members of this sequence in the range up to 40000 are 10, 39, 155 and 371. All are semiprimes and factorise as follows:

  • \(10 = 2 \times 5 \text{ with } 2 + 3 + 5 = 10 \)
  • \(39 = 3 \times 13 \text{ with } 3 + 5 + 7 + 11+13 = 39\)
  • \(155 = 5 \times 31 \text{ with } 5 + 7 + \ldots + 29 + 31=155\)
  • \(371 = 7 \times 53 \text{ with } 7 + 11 + \ldots + 47 + 53=371\)
Because they are semiprimes they are thus equal to the product of their smallest and largest prime factors. However, this is not the case for the next member of the sequence: 2935561623745. The reason is that it is not a semiprime.
  • \(2935561623745= 5 \times 19 \times 53 \times 61 \times 9557887\)

The next member of the sequence 454539357304421 is a semiprime and thus follows the pattern of the first four members of the sequence:
  • \(454539357304421 = 3536123 \times 128541727\)
So we see that 39 by virtue of its membership in OEIS A055233 is rather special. Of course, it has some other interesting qualities. For example, it can be constructed from the first three powers of 3:$$39=3+3^2+3^3$$Gemini also mentions the following number properties:
Beyond these patterns, 39 is also classified as a \( \textbf{Perrin number}\) and a \( \textbf{Størmer number}\), placing it within specialized mathematical sequences that are far from intuitive. 
The number also has an \( \textbf{aliquot sum}\) of 17, which is a prime number, a unique characteristic that links it to a specific aliquot sequence. 
In the realm of number partitions, 39 is notable as the smallest natural number to have three distinct partitions into three parts that all yield the same product, 1200. These partitions are:
  • {25, 8, 6} 
  • {24, 10, 5} 
  • {20, 15, 4}. 
Lastly, in analytic number theory, the \( \textbf{Mertens function}\) returns a value of 0 when given 39, a property that suggests a form of numerical equilibrium or stability, a concept that finds intriguing parallels in other domains. See blog post Zeroes of the Mertens Function.

39 is also what's termed a \( \textbf{perfect totient number} \) because the sum of its iterated totients equals the number itself. Let's confirm this:$$ \begin{align} \phi(39) &=24 \\ \phi(24) &=8 \\ \phi(8) &=4 \\ \phi(4) &=2 \\ \phi(2) &=1 \end{align} $$The sum of these iterated totients equals 39:$$24 + 8 + 4 + 2 + 1 =39$$The perfect totient numbers are listed in OEIS A082897 (permalink):

3, 9, 15, 27, 39, 81, 111, 183, 243, 255, 327, 363, 471, 729, 2187, 2199, 3063, 4359, 4375, 5571, 6561, 8751, 15723, 19683, 36759, 46791, 59049, 65535, 140103, 177147, 208191, 441027, 531441, 1594323, 4190263, 4782969, 9056583, 14348907, 43046721

Saturday, 5 March 2022

Zeroes of the Mertens Function

I examined the Möbius and Mertens functions in a post titled The Möbius Function and Mertens Function on January 25th 2020. In number theory, we define the Mertens function as:$$M(n) = \sum_{1\le k \le n} \mu(k)$$where \( \mu (k)\) is the Möbius function. For any positive integer n, \(μ(n)\) has values in {−1, 0, 1} depending on the factorisation of \(n\) into prime factors:$$\mu(n) = \begin{cases} 1 & \quad \text{if } n \text{ is square-free + integer with even number of prime factors}\\ -1 & \quad \text{if } n \text{ is square-free + integer with odd number of prime factors}\\ 0 & \quad \text{if } n \text{ has a squared prime factor} \end{cases}$$

In that earlier post, I plotted the Mertens function for values up to one million but in this post I want to look at a smaller range and focus on the zeroes of the function in that range. Figure 1 shows a plot of the  Mertens function for values between 25500 and 26080.

Figure 1

We see that in this range, the zeroes occur in a run of three (25514, 25515, 25516) and later singly (26077).  I'm focusing on this range because these numbers are in the vicinity of my current diurnal age which is 26634 as of March 5th 2022. I'm afraid I've missed these previous zeroes in my daily number analysis because they don't register in a search of the OEIS unless you're looking at b-files.

The zeroes of the Mertens function comprise OEIS A028442:


 A028442

Numbers \(k\) such that Mertens's function M(\(k\)) (A002321) is zero.            


The initial values are:
2, 39, 40, 58, 65, 93, 101, 145, 149, 150, 159, 160, 163, 164, 166, 214, 231, 232, 235, 236, 238, 254, 329, 331, 332, 333, 353, 355, 356, 358, 362, 363, 364, 366, 393, 401, 403, 404, 405, 407, 408, 413, 414, 419, 420, 422, 423, 424, 425, 427

Figure 2 shows a further range from 26000 to 26750 where there a lot more zeroes:

Figure 2
Here the zeroes are:

26077, 26134, 26142, 26146, 26153, 26154, 26162, 26163, 26164, 26177, 26179, 26180, 26181, 26183, 26184, 26263, 26264, 26266, 26269, 26273, 26277, 26279, 26280, 26282, 26285, 26321, 26346, 26349, 26350, 26427, 26428, 26430, 26434, 26443, 26444, 26446, 26449, 26450, 26451, 26452, 26454, 26710

The zero upcoming for me is 26710 which is not that far off (Friday, May 20th 2022). After that there is not another zero until Tuesday, April 30th 2024 which is more than two years away. This distant zero will occur as the first in a closely spaced series: 27421, 27429, 27431 and 27432. After that, there is a large gap. See Figure 3.

Figure 3

The full list of zeroes from 27421 to 40000 is as follows:

27421, 27429, 27431, 27432, 27922, 27939, 27940, 27973, 27977, 28009, 28011, 28012, 28014, 28018, 28021, 28031, 28032, 28033, 28127, 28128, 28155, 28156, 28183, 28184, 28189, 28191, 28192, 28193, 28202, 28221, 28254, 28259, 28260, 28262, 28283, 28284, 28290, 28551, 28552, 28554, 28558, 28562, 28565, 28566, 28567, 28568, 29469, 30253, 30262, 30269, 30271, 30272, 33162, 33195, 33196, 33202, 33207, 33208, 33211, 33212, 33342, 33346, 33370, 33373, 33377, 33379, 33380, 33381, 33383, 33384, 33386, 33389, 33390, 33393, 33395, 33396, 33398, 33399, 33400, 33429, 33431, 33432, 33434, 33435, 33436, 33438, 33527, 33528, 33530, 33533, 33534, 35958, 35961, 35963, 35964, 35967, 35968, 35974, 35975, 35976, 35978, 35981, 35982, 36149, 36150, 36154, 36363, 36364, 36415, 36416, 36422, 36423, 36424, 36425, 36561, 36690, 39014, 39015, 39016, 39023, 39024, 39025, 39047, 39048, 39057, 39059, 39060, 39062, 39067, 39068, 39069, 39071, 39072, 39074, 39075, 39076, 39079, 39080, 39082, 39083, 39084, 39093, 39797, 39798, 39801, 39803, 39804, 39811, 39812, 39817

I find the Mertens function oddly fascinating and its graph certainly resembles the graph of cumulative random coin tosses where a tail counts as -1 and a head as +1. In the graph of the Mertens function however, the graph can run along the \(x\) axis for a bit because any number with repeated prime factors counts as 0.

For example, consider the run of zeroes 26449, 26450, 26451, 26452 where we have:

  • \(26449 = 26449\) which has \( \mu \) = -1 which brings the graph to the \(x\) axis
  • \(26450 = 2 \times 5^2 \times 23^2\) which has \( \mu \) = 0 so graph stays on \(x\) axis
  • \(26451 = 3^2 \times 2939\) which has \( \mu \) = 0 so graph stays on \(x\) axis
  • \(26452 = 2^2 \times 17 \times 389\) which has \( \mu \) = 0 so graph stays on \(x\) axis
Once we reach \(6453 = 7 \times 3779\) we have \( \mu \) = 1 and we leave the \(x\) axis.

OEIS A319520 records increasing runs of zero in the Mertens function:


 A319520

Starts of strictly increasing runs of 0's in Mertens's function A002321.         

The initial members of the sequence are 2, 39, 331, 422, 45371, 22898822, 871469945 ... where we have:
  • 2 is a term because M(2) = 0 for a run of one zero
  • 39 is a term because M(39) = M(40) = 0 for a run of two zeroes
  • 331 is a term because M(331) = M(332) = M(333) = 0 for a run of three zeroes
  • 422 is a term because M(422) = ... = M(425) = 0 for a run of four of four zeroes
  • 45371 is a term because M(45371) = ... = M(45376) = 0 for a run of six zeroes
Figure 4 shows the graph of the Mertens function in the vicinity of 45371 to 45376:

Figure 4: permalink

Monday, 5 July 2021

Euler–Mascheroni constant and the Meissel–Mertens constant

I've not written explicitly about either the Euler–Mascheroni constant or the Meissel–Mertens constant before, although the former is made mention of in a Numberphile video that I referenced in a post titled The Harmonic Series on October 12th 2016. 

Let's recount that the harmonic series is simply \(\zeta(1)\) and so:$$\zeta(1)=1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+ \dots =\sum_{n=1}^{\infty}\frac{1}{n}$$While this sequence does diverge it does so very slowly and that's what my post The Harmonic Series was all about. The Euler-Mascheroni constant can be defined as:$$\begin{align}

\gamma &= \lim_{n\to\infty}\left(-\log n + \sum_{k=1}^n \frac1{k}\right)\\

&=\int_1^\infty\left(-\frac1x+\frac1{\lfloor x\rfloor}\right)\,dx.

\end{align}$$Here, \(\lfloor x\rfloor\) represents the floor function. The numerical value of the Euler–Mascheroni constant, to 50 decimal places, is:

0.57721566490153286060651209008240243104215933593992... 

Below I've embedded the Numberphile video referred to earlier as it's really quite informative.



Like the harmonic series, the sum of the reciprocals of the prime numbers diverges also and even more slowly. The Meissel-Mertens constant is defined as:$$M = \lim_{n \rightarrow \infty } \left( \sum_{p \leq n} \frac{1}{p} - \ln(\ln n) \right)=\gamma + \sum_{p} \left[ \ln\! \left( 1 - \frac{1}{p} \right) + \frac{1}{p} \right]$$where \( \gamma \) is the Euler-Mascheroni constant. The value of M is approximately:

M ≈ 0.2614972128476427837554268386086958590516... 

Figure 1: source

The two constants are thus intimately linked. It's easy to generate approximations of these functions using SageMathCell. See Figure 2.

Figure 2: permalink

Looking at the results in Figure 2, it can be seen that:

Approximation of Euler-Mascheroni constant up to 100000 is 0.577220664893197
Approximation of Miessel-Mertens constant up to 100000 is 0.261801821365208

The light grey digits do not correspond to the known digits for these constants. It can be seen that the approximation to the Miessel-Mertens constant is less accurate than for the Euler-Mascheroni constant, reflecting the log(log) computation for the former versus the log computation for the latter.

For a post that shows how to determine the sum of the alternating harmonic series, see my post titled Alternating Series Test from April 23rd 2021. The alternating harmonic series converges thus:$$1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4} \dots=\ln(2) \approx 0.693147180559945 \dots$$See also:

Saturday, 25 January 2020

The Möbius Function and Mertens Function

I had come across the Möbius function before but didn't see it as all that important. However, I was reminded of it recently when I encountered a Numberphile video on Mertens conjecture (uploaded 23rd January 2020).


In number theory, we define the Mertens function as:$$M(n) = \sum_{1\le k \le n} \mu(k)$$where \( \mu (k)\) is the Möbius function. The Mertens conjecture is that for all \(n > 1\): $$\left| M(n) \right| < \sqrt { n }$$To quote from Wikipedia:
In mathematics, the Mertens conjecture is the disproven statement that the Mertens function \(M(n)\) is bounded by \( \sqrt {n}\), which implies the Riemann hypothesis. It was conjectured by Thomas Joannes Stieltjes in an 1885 letter to Charles Hermite (reprinted in Stieltjes (1905)) and Franz Mertens (1897), and disproved by Andrew Odlyzko and Herman te Riele (1985). It is a striking example of a mathematical proof contradicting a large amount of computational evidence in favour of a conjecture.
I set about writing a program in SageMath to plot the first million values of the Mertens function. I managed to execute it in SageMathCell but the code was clunky as I had to get the program to determine the values of -1, 0 and 1 based on the factorisation. Later I realised that the Möbius function would replace the need for this. In SageMath, the spelling is moebius and moebius(1) --> 1 etc. So let's define the Möbius function:

For any positive integer n, \(μ(n)\) has values in {−1, 0, 1} depending on the factorisation of \(n\) into prime factors:$$\mu(n) =
  \begin{cases}
    1       & \quad \text{if } n \text{ is a square-free positive integer with an even number of prime factors}\\
   -1  & \quad \text{if } n \text{ is a square-free positive integer with an odd number of prime factors}\\
0  & \quad \text{if } n \text{ has a squared prime factor}
  \end{cases}$$Figure 1 shows the results of plotting the first one million values of the Möbius function. Here is the permalink to the SageMathCell calculation.

Figure 1

The square root of \( \pm \) 1,000,000 is \( \pm \) 1,000 and as can be seen the function is well within those bounds. However, as mentioned earlier, the bounds are eventually exceeded. Sometimes, instead of \(M(n) \), the function \(m(n) \) is used where:$$m(n)=\frac{M(n)}{\sqrt{n}}$$For the Mertens conjecture to hold, the following condition would be necessary: \(-1 <m(n)<1\). However, for enormously large values of \(n\), it has been shown that \(m(n)<-1.837625 \) and \(m(n)>1.826054\) are possible.