1 Introduction

For \(n \ge 2, 0 \le \ell < n\) and \(x \ge 1\), let

$$\begin{aligned} \varTheta _{x,\ell ,n} := \left\{ j \le x : \left\lfloor \frac{x}{j} \right\rfloor \equiv \ell \ \ (mod \ n) \right\} . \end{aligned}$$
(1)

In our previous paper (Camargo and Martin 2022), we showed that, for certain n and \(L_n \subset \ \{0, 1, \dots , n-1\}\), the sums

$$\begin{aligned} S_{L_n}(x) \ = \ \sum \limits _{j \ \in \bigcup \limits _{\ell \ \in \ L_n} \varTheta _{x,\ell ,n} } \mu (j) \end{aligned}$$
(2)

of the Möbius function are constant (independent of x) for \(x \ge n\). We also showed that some of these constant functions \(S_{L_n}\) are related to certain harmonic schemes used by Tschebyschef and Sylvester to bound the prime counter function \(\varPi (x)\).

A harmonic scheme (named after Sylvester 1912, p. 704) is a couple

$$\begin{aligned} r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m, \ \ r_1 \le r_2 \le \cdots r_q, \ s_1 \le s_2 \le \cdots s_m, \end{aligned}$$
(3)

of sequences of positive integers satisfying

$$\begin{aligned} \sum \limits _{\ell = 1}^{q} \frac{1}{r_\ell } - \sum \limits _{\ell = 1}^{m} \frac{1}{s_\ell } \ = \ 0. \end{aligned}$$
(4)

Historically, harmonic schemes have been associated with two classes of functions. The first class of functions,

$$\begin{aligned} f_\psi [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m](x) \ = \ \sum \limits _{\ell = 1}^{q} T\left( \frac{x}{r_\ell }\right) - \sum \limits _{\ell = 1}^{m} T\left( \frac{x}{s_\ell } \right) , \ x \ge 0, \end{aligned}$$
(5)

\(T(x) \,= \ \log (\lfloor x \rfloor !)\) for \( x \ge 2, \ T(x) = 0\) for \( x < 2\), was used by Tschebyschef and Sylvester (1912, p. 704, and 1852) to bound the Tschebyschef function

$$\begin{aligned} \psi (x) \ = \ \sum \limits _{{\begin{array}{c} p^r \le x \\ p \ \text{ prime } \end{array} }} \log (p). \end{aligned}$$

The second class of functions,

$$\begin{aligned} f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m](x) \ = \ \sum \limits _{\ell = 1}^{q} \left\lfloor \frac{x}{r_\ell } \right\rfloor - \sum \limits _{\ell = 1}^{m} \left\lfloor \frac{x}{s_\ell } \right\rfloor , \ \ x \ge 0, \end{aligned}$$
(6)

was considered later by MacLeod and others (see Cohen et al. 2007; MacLeod 1967 and the references therein) to bound the Mertens function

$$\begin{aligned} M(x) \ = \ \sum \limits _{j \le x} \mu (j), \ x \ge 1 \end{aligned}$$
(7)

(we will often write only \(f_\psi \) or \(f_\mu \) instead of \(f_\psi [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m]\) or \(f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m]\) for the sake of brevity).

In Camargo and Martin (2022), to every \(f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m]\) satisfying

$$\begin{aligned} \text{ Im }(f_\mu ) \ = \ \{0, 1\}, \end{aligned}$$
(8)

we associated a constant component (2) of the Mertens function equal to \(-1\).

Lemma 1

(Corollary 4 and Theorem 7 of Camargo and Martin 2022) Let \(r_1, r_2, \ldots , r_q; s_1, s_2, \dots , s_m\) be a harmonic scheme satisfying (8) and let \(\eta \) be any integer multiple of

$$\begin{aligned} l.c.m(r_1, r_2, \ldots r_q, \ s_1, s_2, \dots , s_m) \end{aligned}$$

(l.c.m stands for the least common multiple). For \(x \ge \eta \),

$$\begin{aligned} -1 = \ q - m \ = \ \sum \limits _{j \ \in \ \bigcup \limits _{{\begin{array}{c} 0 \le u < \eta \\ f_\mu (u) = 1 \end{array}}} \varTheta _{x,u,\eta }} \mu (j). \end{aligned}$$
(9)

In the concluding section of Camargo and Martin (2022), we discussed two following problems: first, we were unable to answer whether there would exist other constant functions \(S_{L_n}\) defined by (2) besides of those described by the right-hand side of (9) and with other values rather than minus one; second, we were unable to find any n odd and \(L_n\) such that the expression in the right-hand side of (2) is constant for \(x \ge n\). We computationally checked that, for \(n = 3, 5, 7, \dots , 17\), the associated function \(S_{L_n}\) is non-constant on [30, 100] for every subset \(L_n\) of \(\{0, 1, \dots , n-1\}\). In this paper, we answer these questions–surprisingly, both answers are relatively simple.

Theorem 1

If the function \(S_{L_n}\) defined by (2) is constant for \(x \ge n\), then \(S_{L_n}\) is given by the right-hand side of (9) for some harmonic scheme satisfying (8) (and, consequently, \(S_{L_n}(x) \ = \ -1\) for \(x \ge n\)).

Theorem 2

If the function \(S_{L_n}\) defined by (2) is constant for \(x \ge n\), then n is even.

In Camargo and Martin (2022), we found some connections between the functions \(f_\psi \) and \(f_\mu \) defined by (5) and (6), respectively. For instance, equation (35) of Camargo and Martin (2022) tells us that

$$\begin{aligned} f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m](k) \ = \ \sum \limits _{j = 1}^{k} b_j \end{aligned}$$
(10)

is the partial sums of the integer coefficients \(b_j\) of the Tschebyschef expansion

$$\begin{aligned} f_\psi [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m](x) \ = \ \sum \limits _{j \ge 1} b_j\psi (x/j). \end{aligned}$$
(11)

The precise definition of the coefficients \(b_j\) in (11) is

$$\begin{aligned} b_j \ = \ \sum \limits _{{\begin{array}{c} 1 \ \le \ i\ \le \ q \\ r_i | j \end{array}}} 1 \ \ \ - \ \ \ \sum \limits _{{\begin{array}{c} 1 \ \le \ i\ \le \ m \\ s_i | j \end{array}}} 1 \end{aligned}$$
(12)

(see equation (30) of Camargo and Martin 2022).

When the non-vanishing \(b_j\) satisfies \(b_j \ \in \ \{-1,1\}\) and alternate in sign with the first one positive, or, equivalently, when (8) holds (see Theorem 8 of Camargo and Martin 2022 for further details), it can be shown (Sylvester 1881, 1912, pp. 704–706) that

$$\begin{aligned} n_1 A \ \le \ \liminf \limits _{x \rightarrow \infty } \frac{\psi (x)}{x} \ \le \ \limsup \limits _{x \rightarrow \infty } \frac{\psi (x)}{x} \ \le \ \frac{n_1 n_2}{n_2-n_1} A, \end{aligned}$$
(13)

where \(n_1\) and \(n_2\) are the first two non-vanishing \(b_j\): \(b_{n_1} = 1\), \(b_{n_2} = -1\) and

$$\begin{aligned} A \ := A[r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m] \ = \ - \sum \limits _{\ell = 1}^{q} \frac{\log (r_{\ell })}{r_{\ell }} + \sum \limits _{\ell = 1}^{m} \frac{\log (s_{\ell })}{s_{\ell }}. \end{aligned}$$
(14)

Similarly to (13), Lemma 1 can be used to bound M(x). In fact, for

$$\begin{aligned} \chi _{f_\mu ,x} \ := \ \bigcup \limits _{{\begin{array}{c} 0 \le u < \eta \\ f_\mu (u) = 1 \end{array}}} \varTheta _{x,u,\eta }, \end{aligned}$$
(15)

we get

$$\begin{aligned} |M(x)| \ \le \ \left| \sum \limits _{j \ \in \ \chi _{f_\mu ,x}} \mu (j)\right| \ + \ \left| \sum \limits _{j \ \notin \ \chi _{f_\mu ,x}} \mu (j)\right| \ {\mathop {\le }\limits ^{(\text {9})}} \ 1 + x - \# \chi _{f_\mu ,x}. \end{aligned}$$
(16)

A slightly improved estimate is

$$\begin{aligned} |M(x)|\ \le \ 1 + \left[ Q(x) - \# (\chi _{f_\mu ,x} \cap Supp(\mu )) \right] , \end{aligned}$$
(17)

where

$$\begin{aligned} Q(x) \ = \ \sum \limits _{j \le x} |\mu (j)| \end{aligned}$$

counts the square-free numbers up to x.

Inequalities (16) and (17) were implicitly used in the past to estimate M(x) (see MacLeod 1967 and the references therein, and also Cohen et al. 2007 for more modern techniques). Motivated by them, we analyzed the asymptotic size (as \(x \rightarrow \infty \)) of the sets that appear on the right-hand sides of (16) and (17). Our study revealed other interesting connections between the theories built on functions \(f_\psi \) and \(f_\mu \).

Theorem 3

Under the hypotheses of Lemma 1,

$$\begin{aligned} \# \chi _{f_\mu ,x} \ = \ A x + O(\sqrt{x}) \end{aligned}$$
(18)

and

$$\begin{aligned} \# \chi _{f_\mu ,x} \cap {{\,\textrm{supp}\,}}(\mu ) \ = \ \frac{6}{\pi ^2}A x + O\left( \sqrt{x}\right) , \end{aligned}$$
(19)

with A defined by (14) and \(\chi _{f_\mu ,x}\) defined by (15). The underlying constants in the O-notation may depend on \(f_\mu \).

The number A defined in (14) was called by Sylvester the Stigmata of the harmonic scheme \(r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m\) (perhaps by its role in (13)). By the Prime number theorem, \(\psi (x) \sim x,\)

$$\begin{aligned} \displaystyle \frac{f_\psi (x)}{x} \ {\mathop {=}\limits ^{(\text {11})}} \sum \limits _{j \ge 1} \frac{b_j}{j}\frac{\psi (x/j)}{x/j} \ \sim \ \sum \limits _{j =1}^{\infty } \frac{b_j}{j}. \end{aligned}$$

However, by Stirling approximation, \(f_\psi (x)\) is asymptotic to Ax. In other words, we have

Lemma 2

Let \(r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m\) be a harmonic scheme and let \(b_j\) and A be defined by (11) and (14), respectively. We have

$$\begin{aligned} \sum \limits _{j =1}^{\infty } \frac{b_j}{j} \ = \ A \ = \ -\sum \limits _{\ell = 1}^{q} \frac{\log (r_{\ell })}{r_{\ell }} + \sum \limits _{\ell = 1}^{m} \frac{\log (s_{\ell })}{s_{\ell }}. \end{aligned}$$
(20)

We give two simple proofs of Lemma 2. The first is based on the direct analysis of the partial sums \(\sum \limits _{j =1}^{n} \frac{b_j}{j}\). The second is an immediate consequence of a different estimate for the quantities in Theorem 3:

Theorem 4

$$\begin{aligned} \# \chi _{f_\mu ,x} \ \sim \ \displaystyle \left( \sum \limits _{j=1}^{\infty } \frac{b_j}{j}\right) x \end{aligned}$$
(21)

and

$$\begin{aligned} \# \chi _{f_\mu ,x} \cap Supp(\mu ) \ \sim \ \displaystyle \frac{6}{\pi ^2}\left( \sum \limits _{j=1}^{\infty } \frac{b_j}{j}\right) x, \end{aligned}$$
(22)

with \(b_j\) defined by (11) and \( \chi _{f_\mu ,x} \) defined in (15).

2 Proofs

We start with some results which could be of independent interest.

Lemma 3

Let \(r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m\) be a harmonic scheme. The associated function \(f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m](x)\) defined by (6) has period \(T \ = \ l.c.m(r_1, r_2, \ldots r_q, \ s_1, s_2, \dots , s_m)\).

Proof

Let \(T^*\) be the period of \(f_\mu \). After collecting occasionally identical terms, we rewrite \(f_\mu \) as

$$\begin{aligned} f_\mu (x) \ = \ \sum \limits _{j = 1}^{k} c_j\left\lfloor \frac{x}{a_j} \right\rfloor , \end{aligned}$$

with non-vanishing coefficients \(c_j\), \(a_i < a_j\) for \(i < j\), \(T \ = \ l.c.m(a_1, a_2, \ldots a_k)\) and

$$\begin{aligned} \sum \limits _{j = 1}^{k} \frac{c_j}{a_j} \ {\mathop {=}\limits ^{(\text {4})}} 0. \end{aligned}$$
(23)

Note that

$$\begin{aligned} f_\mu (x + T) \ = \ T \sum \limits _{j = 1}^{k} \frac{c_j}{a_j} \ + \ \sum \limits _{j = 1}^{k} c_j\left\lfloor \frac{x}{a_j} \right\rfloor \ {\mathop {=}\limits ^{(\text {23})}} f_\mu (x). \end{aligned}$$

Therefore \(T^* | T\). We now proceed by showing that

$$\begin{aligned} a_j \mid T^*, \ j = 1, 2 \dots , k, \end{aligned}$$
(24)

what is sufficient to complete the proof. In order to prove (24), we shall build a sequence of periodic functions \(f_{\mu ,1}, f_{\mu ,2}, \dots , f_{\mu ,k}\) of the form

$$\begin{aligned} f_{\mu ,\ell }(x) \ = \ \sum \limits _{j = \ell }^{k} c_j\left\lfloor \frac{x}{a_j} \right\rfloor \ + \ \beta _\ell \left\lfloor \frac{x}{T^*} \right\rfloor , \end{aligned}$$
(25)

such that each \(f_{\mu ,\ell }\) has period \(T_\ell \), with

$$\begin{aligned} T_\ell | T^*. \end{aligned}$$
(26)

Let us first show that (25) and (26) are enough to ensure that \(a_\ell | T^*\). In fact, we have

$$\begin{aligned} f_{\mu ,\ell }(x) \ = \ 0 \ \text{ for } \ x < \min \{a_\ell , T^*\}. \end{aligned}$$
(27)
  • If \(a_\ell = T^*\), there is nothing to prove.

  • If \(a_\ell < T^*\), then \(\quad f_{\mu ,\ell }(a_\ell ) \ = \ c_\ell \ \ne \ 0\). This and (27) ensure that \(a_\ell | T_\ell \) and (26) implies that \(a_\ell | T^*\).

  • In the case \(a_\ell > T^*\), we must to consider two sub-cases:

    • If \(\beta _\ell = 0\), the first non-vanishing value of \(\quad f_{\mu ,\ell }\) is \(\quad f_{\mu ,\ell }(a_\ell ) = c_\ell \ne 0\). This is absurd, because \(\quad f_{\mu ,\ell }\) has period \(T^*\) and it is vanishing in \([0,T^*]\) (see (27)).

    • If \(\beta _\ell \ne 0\), (27) tells us that

      $$\begin{aligned} f_{\mu ,\ell }(x) \ = \ 0 \ \text{ for } \ x < T^* \quad \text{ and } \quad f_{\mu ,\ell }(T^*) \ = \ \beta _\ell \ \ne 0. \end{aligned}$$

      We now use the periodicity of \(f_{\mu ,\ell }\) to evaluate \(f_{\mu ,\ell }\) at x of the form \(\lambda T^* T\), where \(\lambda \) is a free (integer) parameter:

      $$\begin{aligned} \beta _\ell \ = \ f_{\mu ,\ell }(\lambda T T^*) \ {\mathop {=}\limits ^{(\text {25})}} \lambda T T^* \left( \frac{\beta _\ell }{T^*} + \sum \limits _{j = \ell }^{k} \frac{c_j}{a_j} \right) . \end{aligned}$$
      (28)

      This is absurd, because the right-hand side of (28) is either identically vanishing, or it is a non-constant linear function in \(\lambda \).

The sequence \(f_{\mu ,1}, f_{\mu ,2}, \dots , f_{\mu ,k}\) is defined inductively as follows:

  • \(f_{\mu ,1} = f_{\mu }\).

  • \(\displaystyle f_{\mu ,\ell +1} = f_{\mu ,\ell } - c_\ell \left( \left\lfloor \frac{x}{a_\ell } \right\rfloor - \frac{T^*}{a_\ell }\left\lfloor \frac{x}{T^*} \right\rfloor \right) , \ \ell = 1, 2, \dots , k-1.\)

We proved that \(\frac{T^*}{a_\ell }\) is integer, so the term in brackets in the definition of \(f_{\mu ,\ell +1}\) has period \(T^*\) when \(a_\ell \ne T^*\). \(\square \)

Corollary 1

The sequence \((b_j)_{j \ge 1}\) defined by (12) is periodic with period \(T \ = \ l.c.m(r_1, r_2, \ldots r_q, \ s_1, s_2, \dots , s_m)\).

Proof

By (10), we have

$$\begin{aligned} b_j \ = \ f_\mu (j) - f_\mu (j-1), \ j \ge 1. \end{aligned}$$

This and Lemma 3 tell us that the sequence \((b_j)_{j \ge 1}\) is periodic with some period \(T^*\) such that \(T^* | T\). Moreover, the definition of \(f_\mu \) and (4) give

$$\begin{aligned} f_\mu (T) \ = \ 0. \end{aligned}$$

Polling all this together, we get

$$\begin{aligned} \displaystyle 0 \ = \ f_\mu (T) \ {\mathop {=}\limits ^{(\text {10})}} \sum \limits _{k = 1}^{T/T^*} \sum \limits _{j = 1}^{T^*} b_{(k-1)T^* + j} \ = \ \frac{T}{T^*}\sum \limits _{j = 1}^{T^*} b_j. \end{aligned}$$

This and (10) tell that

$$\begin{aligned} f_\mu (T^* + k) \ = \ \sum \limits _{j = T^*+1}^{T^*+k} b_{j} \ = \ \sum \limits _{j = 1}^{k} b_{j} \ = \ f_\mu (k) \ \forall k \ge 0, \end{aligned}$$

what implies \(T |T^*\). \(\square \)

2.1 Proof of Theorem 1

Assume that \(n \ge 2\), \(L_n \ = \ \{\ell _1, \ell _2, \dots \ell _k \} \subset \ \{0, 1, \dots , n-1\}\) and \(c \ \in \mathbb Z\) are such that

$$\begin{aligned} S_{L_n}(x) \ = \ \sum \limits _{j \ \in \bigcup \limits _{\ell \ \in \ L_n} \varTheta _{x,\ell ,n} } \mu (j) \ = \ c \end{aligned}$$
(29)

for \(x \ge n\). Note that

$$\begin{aligned} S_{L_n}(x) \ = \ \sum \limits _{j \le x} \mu (j)g(x/j), \end{aligned}$$

with

$$\begin{aligned} g(y) \ = \ \left\{ \begin{array}{cl} 1, &{}\quad \text{ if } \ \lfloor y \rfloor \ \equiv \ell _\nu \ \ (mod \ n) \ \text{ for } \text{ some } \ \nu \le k, \\ 0, &{}\quad \text{ otherwise }. \\ \end{array}\right. \end{aligned}$$
(30)

By the Möbius inversion formula (Apostol 1976, Thm. 2.23)

$$\begin{aligned} g(x)&= \sum \limits _{j \le x} S_{L_n}(x/j) \nonumber \\&= \sum \limits _{j \le x/n} S_{L_n}(x/j) \ + \ \sum \limits _{x/n< j \le x} S_{L_n}(x/j) \nonumber \\&{\mathop {=}\limits ^{(\text {29})}} \displaystyle c \left\lfloor \frac{x}{n} \right\rfloor \ + \ \sum \limits _{i < n} S_{L_n}(i) \left( \left\lfloor \frac{x}{i} \right\rfloor - \left\lfloor \frac{x}{i+1} \right\rfloor \right) . \end{aligned}$$
(31)

Moreover, because g is bounded, we must have

$$\begin{aligned} \displaystyle c\frac{1}{n} \ + \ \sum \limits _{i < n} S_{L_n}(i) \left( \frac{1}{i} - \frac{1}{i+1} \right) \ = \ 0. \end{aligned}$$
(32)

This shows that \(g = f_\mu [r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m]\) is the function associated to the harmonic scheme described by (32). By Lemma 3, \(f_\mu \) is periodic with period \(T \ = \ l.c.m(r_1, r_2, \ldots r_q, \ s_1, s_2, \dots , s_m)\) and (30) tells us that

$$\begin{aligned} T \mid n. \end{aligned}$$
(33)

Finally, Lemma 2 and Corollary 7 of Camargo and Martin (2022) tell us that, for \(x \ge n\),

$$\begin{aligned} -1 = q - m \ = \ \overbrace{\sum \limits _{j \le x} \mu (j) f_\mu (x/j)}^{S_{L_n}(x)} \ = \ \left( \sum \limits _{j \ \in \ \varOmega } \mu (j) \right) , \end{aligned}$$

where \(\varOmega \ = \bigcup \nolimits _{{\begin{array}{c} 0 \le u < n \\ f_\mu (u) = 1 \end{array}}} \varTheta _{x,u,n}\). \(\square \)

Example 1

Let us consider the following constant component of the Mertens function taken from Table 3 of Camargo and Martin (2022)

$$\begin{aligned} S(x) \ = \ \displaystyle \sum \limits _{j \le x} \mu (j) f(x/j), \quad f(x) \ = \ \left\lfloor x \right\rfloor - \left\lfloor \frac{x}{2} \right\rfloor - \left\lfloor \frac{x}{3} \right\rfloor - \left\lfloor \frac{x}{4} \right\rfloor + \left\lfloor \frac{x}{12} \right\rfloor , \end{aligned}$$

whose value is \(c = -1\) for \(n \ge 12\). We have

$$\begin{aligned} f(j) = 1 \ \text{ for } \ j \ \in \ \{1,2,3,5,7,11\}, \quad f(j) = 0 \ \text{ for } \ j \ \in \ \{4,6,8,9,10,12\}, \end{aligned}$$

and

$$\begin{aligned} S(1)= & {} 1, \quad S(2) = 0, \quad S(3) = -1, \quad S(4) = -2, \\ S(5)= & {} -2, \quad S(6) = -2, \quad S(7) = -2,\quad S(8) = -2, \\ S(9)= & {} -2, \quad S(10) = -2,\quad S(11) = -2, \quad S(12) = -1. \end{aligned}$$

By (31), the function g defined by (30) satisfies

$$\begin{aligned} g(x)= & {} \displaystyle - \left\lfloor \frac{x}{12} \right\rfloor \ + \ \left( \left\lfloor x \right\rfloor - \left\lfloor \frac{x}{2} \right\rfloor \right) - \left( \left\lfloor \frac{x}{3} \right\rfloor - \left\lfloor \frac{x}{4} \right\rfloor \right) -2 \sum \limits _{i = 4}^{11} \left( \left\lfloor \frac{x}{i} \right\rfloor - \left\lfloor \frac{x}{i+1} \right\rfloor \right) \\= & {} \displaystyle \left\lfloor x \right\rfloor - \left\lfloor \frac{x}{2} \right\rfloor - \left\lfloor \frac{x}{3} \right\rfloor - \left\lfloor \frac{x}{4} \right\rfloor + \left\lfloor \frac{x}{12} \right\rfloor , \end{aligned}$$

that is, the link between \(g = f\) and the harmonic scheme 1, 12; 2, 3, 4 can be recovered by the values of S, as predicted by Theorem 1.

2.2 Proof of Theorem 2

By Theorem 1, we can assume that the given constant component of the Mertens function \(S_{L_n}(x)\) is of the form (9) for some harmonic scheme \(r_1, r_2, \ldots , r_q; \ s_1, s_2, \dots , s_m\). Because \(m = q+1\) (see (9)), \(q+m\) is odd. This and condition

$$\begin{aligned} \sum \limits _{\ell = 1}^{q} \frac{1}{r_\ell } - \sum \limits _{\ell = 1}^{m} \frac{1}{s_\ell } \ = \ 0 \end{aligned}$$

tell us that at least one among the numbers \(r_1, r_2, \ldots , r_q, s_1, s_2, \dots , s_m\) must be even (a sum of an odd number of odd integers can not be zero). Hence, by (33), n is even. \(\square \)

2.3 Proof of Theorem 3

Let

$$\begin{aligned} \varPhi _{f_\mu }(x) \ = \ \sum \limits _{j \le x} f_\mu (x/j). \end{aligned}$$

Following the proof of Lemma 2 of Camargo and Martin (2022), for fixed \(x \ge \eta \) and \(j \le x\), write

$$\begin{aligned} \frac{x}{j} = a \, \eta + u + \delta , \ \ \text{ with } \ \ a, u \in \ \mathbb N, \ \ \ 0 \le u< \eta \ \ \text{ and } \ \ 0 \le \delta < 1. \end{aligned}$$

Note that

$$\begin{aligned} f_\mu (x/j)&= \sum \limits _{\ell = 1}^{q} \left\lfloor \frac{x/j}{r_\ell } \right\rfloor - \sum \limits _{\ell = 1}^{m} \left\lfloor \frac{x/j}{s_\ell } \right\rfloor \\&= \sum \limits _{\ell = 1}^{q} \left( a \frac{\eta }{r_\ell } \ + \ \left\lfloor \frac{u+\delta }{r_\ell } \right\rfloor \right) - \sum \limits _{\ell = 1}^{m} \left( a \frac{\eta }{s_\ell } \ + \ \left\lfloor \frac{u+\delta }{s_\ell }\right\rfloor \right) \\&{\mathop {=}\limits ^{(\text {4})}} \sum \limits _{\ell = 1}^{q} \left\lfloor \frac{u}{r_\ell } \right\rfloor - \sum \limits _{\ell = 1}^{m} \left\lfloor \frac{u}{s_\ell }\right\rfloor \ = \ f_\mu (u). \end{aligned}$$

Therefore, \(f_\mu (x/j) = 1\) if and only if \(f_\mu (u) = 1, \ \ u = \ \left\lfloor \frac{x}{j} \right\rfloor \ (\text{ mod } \ \eta )\). In other words,

$$\begin{aligned} \{ j \le x: f_\mu (x/j) = 1 \} \ = \ \bigcup \limits _{{\begin{array}{c} 0 \le u \le \eta \\ f_\mu (u) = 1 \end{array}}} \varTheta _{x,u,\eta } \ {\mathop {=}\limits ^{(\text {15})}} \chi _{f_\mu ,x}. \end{aligned}$$

Hence,

$$\begin{aligned} \varPhi _{f_\mu }(x) \ = \ \# \chi _{f_\mu ,x}, \end{aligned}$$
(34)

since \(\text{ Im }(f_\mu ) \ = \ \{0, 1\}\). Analogously, for

$$\begin{aligned} \tilde{\varPhi }_{f_\mu }(x) \ := \ \sum \limits _{j \le x} |\mu (j)|f_\mu (x/j), \end{aligned}$$

we obtain

$$\begin{aligned} \tilde{\varPhi }_{f_\mu }(x) \ = \ \# \chi _{f_\mu ,x} \cap Supp(\mu ). \end{aligned}$$

Note that

$$\begin{aligned} \varPhi _{f_\mu }(x) \ = \ \sum \limits _{\ell = 1}^{q} D\left( \frac{x}{r_\ell } \right) - \sum \limits _{\ell = 1}^{m} D\left( \frac{x}{s_\ell } \right) , \end{aligned}$$
(35)

where

$$\begin{aligned} D(y) \ = \ \sum \limits _{j \le y} \left\lfloor \frac{y}{j} \right\rfloor \ = \ \sum \limits _{ab \le y} 1. \end{aligned}$$

By Theorem 3.3 of Apostol (1976),

$$\begin{aligned} D(y) = y\log (y) + (2\gamma -1)y + O(\sqrt{y}) \end{aligned}$$

(\(\gamma \) is the Euler–Mascheroni constant). Hence, by (34) and (35),

$$\begin{aligned} \# \chi _{f_\mu ,x}&= \displaystyle \sum \limits _{\ell = 1}^{q} \frac{x}{r_\ell }\log \left( \frac{x}{r_\ell }\right) + (2\gamma -1)\frac{x}{r_\ell } \\&\quad \, - \left[ \displaystyle \sum \limits _{\ell = 1}^{m} \frac{x}{s_\ell }\log \left( \frac{x}{s_\ell }\right) + (2\gamma -1)\frac{x}{s_\ell }\right] + O(\sqrt{x}) \\&{\mathop {=}\limits ^{(\text {4})}} \displaystyle \left( - \sum \limits _{\ell = 1}^{q} \frac{\log (r_{\ell })}{r_{\ell }} + \sum \limits _{\ell = 1}^{m} \frac{\log (s_{\ell })}{s_{\ell }} \right) x \ + \ O(\sqrt{x}). \end{aligned}$$

The underlying constant in the O-notation depends on m and q. This proves (18).

The proof of (19) follows along the same lines, using \(\tilde{\varPhi }_{f_\mu }(x)\) instead of \(\varPhi _{f_\mu }(x)\) in (35), replacing D by the function

$$\begin{aligned} \tilde{D}(y) \ = \ \sum \limits _{j \le y} |\mu (j)|\left\lfloor \frac{y}{j} \right\rfloor \ = \ \sum \limits _{ab \le y} |\mu (a)| \end{aligned}$$

and using that Kumchev (2000)

$$\begin{aligned} \tilde{D}(y) \ = \ \displaystyle \frac{1}{\zeta (2)} y\log (y) + \left( \frac{2\gamma -1}{\zeta (2)} - 2\frac{\zeta '(2)}{\zeta (2)^2}\right) y + O(\sqrt{y}) \end{aligned}$$

(\(\zeta \) is the Riemann zeta function). \(\square \)

2.4 Proof of Lemma 2

By (12), we have

$$\begin{aligned} \sum \limits _{j =1}^{n} \frac{b_j}{j}&= \sum \limits _{j =1}^{n} \frac{1}{j}\left( \sum \limits _{{\begin{array}{c} 1 \ \le \ i\ \le \ q \\ r_i | j \end{array}}} 1 \ \ \ - \ \ \ \sum \limits _{{\begin{array}{c} 1 \ \le \ i\ \le \ m \\ s_i | j \end{array}}} 1 \right) \\&= \left( \sum \limits _{i = 1}^{q} \sum \limits _{j =1}^{n/r_i} \frac{1}{j \, r_i} \right) \ \ \ - \ \ \ \left( \sum \limits _{i = 1}^{m} \sum \limits _{j =1}^{n/s_i} \frac{1}{j \, s_i} \right) \\&= \left( \sum \limits _{i = 1}^{q} \frac{1}{r_i} \left[ \log (n/r_i) + \gamma + O\left( \frac{r_i}{n} \right) \right] \right) \\&\quad \,- \left( \sum \limits _{i = 1}^{m} \frac{1}{s_i}\left[ \log (n/s_i) + \gamma + O\left( \frac{s_i}{n} \right) \right] \right) \\&= \left( \sum \limits _{i = 1}^{q} \frac{1}{r_i} - \sum \limits _{i = 1}^{m} \frac{1}{s_i}\right) [ \log (n)+\gamma ] \ + \ A \ + \ O\left( \frac{1}{n}\right) \\&{\mathop {=}\limits ^{(\text {4})}} A \ + \ O\left( \frac{1}{n}\right) . \end{aligned}$$

The underlying constant in the O-notation depends \(r_1, r_2, \ldots , r_q, \ s_1, s_2, \dots , s_m\). \(\square \)

2.5 Proof of Theorem 4

We have

$$\begin{aligned} \# \chi _{f_\mu ,x} = \sum \limits _{u = 0}^{\eta -1} f_\mu (u) \#\varTheta _{x,u,\eta }. \end{aligned}$$

The exact value of \(\#\varTheta _{x,u,\eta }\) is given by the alternating series

$$\begin{aligned} \#\varTheta _{x,u,\eta } \ = \ \displaystyle \sum \limits _{j \ge 0} \left( \left\lfloor \frac{x}{j\eta +u} \right\rfloor \ - \ \left\lfloor \frac{x}{j\eta +u+1} \right\rfloor \right) , \ \ \ u < \ \eta \end{aligned}$$
(36)

(with the convention that j starts with 1 for \(u = 0\)). Note that, for every fixed x, the terms in (36) alternate in sign and are non-increasing. Therefore, for every \(k > 0\),

$$\begin{aligned} \left| \#\varTheta _{x,u,\eta } - \displaystyle \sum \limits _{j = 0}^{k} \left( \left\lfloor \frac{x}{j\eta +u} \right\rfloor \ - \ \left\lfloor \frac{x}{j\eta +u+1} \right\rfloor \right) \right| \le \left\lfloor \frac{x}{(k+1)\eta +u} \right\rfloor . \end{aligned}$$
(37)

By (37), we get,

$$\begin{aligned} \#\varTheta _{x,u,\eta } \ = \ \displaystyle x \sum \limits _{j = 0}^{k} \left( \frac{1}{j\eta +u} \ - \ \frac{1}{j\eta +u+1} \ \right) \ + \ O\left( \frac{x}{(k+1)\eta +u} \ + \ x\frac{k}{x} \right) , \end{aligned}$$

where the implicit constant is absolute (does not depend on k or x). Hence, taking k large and x/k large, we see that

$$\begin{aligned} \#\varTheta _{x,u,\eta } \ \sim \ x \displaystyle \sum \limits _{j = 0}^{\infty } \left( \frac{1}{j\eta +u} \ - \ \frac{1}{j\eta +u+1} \right) . \end{aligned}$$
(38)

By (38),

$$\begin{aligned} \displaystyle \frac{ \# \chi _{f_\mu ,x}}{x}\sim & {} \displaystyle \sum \limits _{u = 1}^{\eta -1} f_\mu (u) \sum \limits _{j = 0}^{\infty } \left( \frac{1}{j\eta +u} \ - \ \frac{1}{j\eta +u+1}\right) \nonumber \\= & {} \displaystyle \sum \limits _{j = 0}^{\infty } \, \sum \limits _{u = 1}^{\eta -1} f_\mu (u) \left( \frac{1}{j\eta +u} \ - \ \frac{1}{j\eta +u+1}\right) . \end{aligned}$$
(39)

Because \(f_\mu (k) \ {\mathop {=}\limits ^{(\text {10})}} \sum \limits _{q \le k} b_q\) and \(f_\mu (\eta ) = 0\), summing the right-hand side of (39) by parts (see Proposition 1.3.1 of Jameson 2004) gives

$$\begin{aligned} \displaystyle \frac{\# \chi _{f_\mu ,x}}{x} \sim \displaystyle \sum \limits _{j = 0}^{\infty } \, \sum \limits _{u = 1}^{\eta } \frac{b_u}{j\eta +u} \ = \ \sum \limits _{u = 1}^{\eta } \, \sum \limits _{j = 0}^{\infty } \frac{b_u}{j\eta +u}. \end{aligned}$$
(40)

By Corollary 1, the sequence \((b_j)_{j \ge 1}\) is periodic with period

$$\begin{aligned} T \ = \ l.c.m(r_1, r_2, \ldots r_q, \ s_1, s_2, \dots , s_m). \end{aligned}$$

Since \(T | \eta \) by hypothesis, we get \(b_u = b_{j\eta + u} \ \forall j \ge 0\). This and (40) complete the proof of (21).

The proof of (22) is analogous. \(\square \)