1 Introduction

A sequence \(\{x_k\}\) of real numbers is said to be uniformly distributed mod 1 if

$$\begin{aligned} \frac{1}{N} {}^\# \{ k\le N \mid \langle x_k \rangle \in [a, b)\} \rightarrow b-a, \quad (N\rightarrow \infty ), \end{aligned}$$

for all \(0\le a< b< 1\), where \(\langle x\rangle \) denotes the fractional part \(x - [x]\) of a real number x. Since the convergence is uniform in a and b, the following discrepancy is used to measure its speed.

$$\begin{aligned} D_N\{x_k \}&= \sup _{0\le a< b< 1} \left| \frac{1}{N} {}^\# \{ k\le N \mid \langle x_k \rangle \in [a, b)\} - (b-a) \right| . \end{aligned}$$

For an arithmetic progression \(\{n_k\}\), the order of convergence of \(D_N\{n_k x\}\) was studied by Khintchin [9] and Kesten [8]. For uniformly distributed i.i.d. \(\{U_k\}\), Chung-Smirnov theorem asserts the law of the iterated logarithm

$$\begin{aligned} \varlimsup _{N\rightarrow \infty } \frac{ND_N \{U_k\}}{\sqrt{2N\log \log N}} = \frac{1}{2} ,\quad \hbox {a.s.} \end{aligned}$$

By various studies on lacunary series, it is known that a sequence \(\{n_kx \}\) behaves like uniformly distributed i.i.d. when \(\{n_k\}\) diverges rapidly. Actually Philipp [10] followed Takahashi’s method [11] and proved the result below by assuming the Hadamard gap condition \(n_{k+1}/ n_k \ge q > 1\).

$$\begin{aligned} \frac{1}{4\sqrt{2}} \le \varlimsup _{N\rightarrow \infty } \frac{ND_N \{n_k x\}}{\sqrt{2N\log \log N}} \le \frac{1}{\sqrt{2}} \left( 166 + \frac{664}{q^{1/2} -1}\right) , \quad \hbox {a.e.} \end{aligned}$$

Dhompongsa [3] proved that the limsup equals to \(\tfrac{1}{2}\) when \(\{n_k\}\) satisfies very strong gap condition \( \lim _{k\rightarrow \infty }({\log (n_{k+1}/ n_k)})/{ \log \log k} = \infty \). Beside of these results, any concrete value of limsup for exponentially growing sequence was not determined before the recent results below on divergent geometric progressions \(\{\theta ^k x\}\).

Theorem 1

[47] For any \(\theta \notin [-1,1]\), there exists a constant \(\varSigma _\theta \ge 1/2\) such that

$$\begin{aligned} \varlimsup _{N\rightarrow \infty } \frac{ND_N \{\theta ^k x\}}{\sqrt{2N\log \log N}} = \varSigma _\theta ,\quad \mathrm{a.e. } \end{aligned}$$

If \(\theta ^j \notin \mathbf{Q}\) for any \(j \in \mathbf{N}\), then \(\varSigma _\theta = \frac{1}{2}\), and otherwise \(\varSigma _\theta > \frac{1}{2}\). When \(\theta \) satisfies \(\theta ^j \in \mathbf{Q}\) for some \(j \in \mathbf{N}\), we take p, q, and r as below.

$$\begin{aligned} \theta ^r= p/q \quad \mathrm{where} \quad r=\min \{j\in \mathbf{N}\mid \theta ^j\in \mathbf{Q}\}, \quad p\in \mathbf{Z},\quad q\in \mathbf{N}, \quad \gcd (p,q)=1. \end{aligned}$$
(1)

If p and q are odd, then

$$\begin{aligned} \varSigma _\theta = \frac{1}{2}\sqrt{\frac{|p|q+1}{|p|q-1}}. \end{aligned}$$

If \(q=1\), then

$$\begin{aligned} \varSigma _\theta = \frac{1}{2}\sqrt{\frac{|p|+1}{|p|-1}}, \quad \frac{1}{2}\sqrt{ \frac{(|p|+1)|p|(|p|-2)}{(|p|-1)^3}}, \quad \frac{1}{9}{\sqrt{42}}, \quad \mathrm{or}\quad \frac{1}{49}{\sqrt{910}}, \end{aligned}$$

according as p is odd, \(|p|\ge 4\) is even, \(p=2\), or \(p=-2\). If \(p=\pm 5\) and \(q=2\), then

$$\begin{aligned} \varSigma _\theta = \frac{1}{9}{\sqrt{22}} . \end{aligned}$$

For related works, see [1, 2]. In this paper, we prove the next result and determine \(\varSigma _\theta \) when \(\theta \) is large.

Theorem 2

Suppose that \(\theta \) satisfies (1). If p is odd, q is even and \(|p/q|\ge 9/4\), or if p is even, q is odd and \(|p/q|\ge 4\), then

$$\begin{aligned} \varSigma _{\theta }= & {} \left( \frac{(|p|q)^{I}+1}{(|p|q)^{I}-1} v\left( \frac{|p|-q-1}{2(|p|-q)}\right) \right. \nonumber \\&\left. +\, \frac{2(|p|q)^{I}}{(|p|q)^{I}-1} \sum _{m=1}^{I-1} \frac{1}{(|p|q)^{m}} v\left( q^m\frac{|p|-q-1}{2(|p|-q)}\right) \right) ^{1/2}, \end{aligned}$$
(2)

where \(v(x)=\langle x \rangle (1-\langle x\rangle )\) and \(I=\min \{ n\in \mathbf{N}\mid q^n = \pm 1 \mod |p|-q\}\).

By (2), we can calculate the concrete values of \(\varSigma _\theta \) in the following way.

$$\begin{aligned}&\varSigma _{\pm 7/2}= \frac{1}{5}\sqrt{\frac{1294}{195}}, \quad \varSigma _{\pm 9/2}= \frac{2}{49}\sqrt{\frac{18561}{119}},\\&\quad \varSigma _{\pm 14/3}= \frac{1}{11}\sqrt{\frac{4096559910}{130691231}},\quad \varSigma _{\pm 9/4}= \frac{1}{5}\sqrt{\frac{222}{35}},\dots \end{aligned}$$

When \(q=1\) and \(|p|\ge 4\) is even, we have \(I=1\), and (2) gives the values stated in Theorem 1. It also gives the value \(\varSigma _{\pm 5/2}\) in Theorem 1.

We here emphasize that the values of \(\varSigma _\theta \) are determined for large \(\theta \), say, that satisfying \(|\theta |\ge 4\). On the other hand, we can find some smaller p / q for which (2) fails to hold. \(\theta =\pm 2\) is one such example.

Before closing this section, we note that the conditions \(|p/q|\ge 9/4\) and \(|p/q|\ge 4\) are superfluous, and much weaker conditions are sufficient. Set

$$\begin{aligned} A_1(p,q):= & {} 2p^3-(4q+2)p^2-(q^2-2q)p+3q^2,\\ A_2(p,q):= & {} (8 q^2 - 6)p^3 +(- 16 q^3 + 4 q + 24)p^2 +(- q^4 + 10 q^2 - 24 q - 24)p +q^3,\\ A_3(p,q):= & {} p^3-(4q+1)p^2+2pq+2q^2\\ A_4(p,q):= & {} (6 q^2 - 4) p^6 +(- 4 q^3 + 8 q^2 + 2 q + 16)p^5 +(- 25 q^4 - 24 q - 16)p^4\\&+\,(12 q^5 - 24 q^4 \!+\! 25 q^3 \!+\! 8 q^2 \!-\! 2 q)p^3 +(- 4 q^6 + 16 q^5 - 12 q^4 + 32 q^3 - 8 q^2)p^2\\&+\,(4 q^5 - 32 q^4 - 10 q^3)p -4q^4. \end{aligned}$$

When p is odd and q is even, if the conditions \(A_1(|p|, q) >0\), \(A_2(|p|, q)>0\), and

$$\begin{aligned} |p/q| \ge 2, \end{aligned}$$
(3)

are satisfied, then we have (2). The condition \(|p/q|> 9/4\) implies these conditions. Although \(A_1(9, 4)< 0\) and \(A_2(9, 4)>0\), we can still prove (2) for \(p/q=\pm 9/4\). We here note that \(|p/q|\ge (2+\sqrt{6})/2 + 1/q\) also implies \(A_1(|p|, q) >0\) and \(A_2(|p|, q)>0\).

When p is odd and q is even, if (3), \(A_3(|p|, q)>0\) and \(A_4(|p|, q)>0\) are satisfied, then (2) holds. The condition \(|p/q|\ge 4\) implies these conditions.

2 Preliminary

We prepare some results. Proofs can be found in [4, 6, 7]. For a, b, \(a'\), \(b'\in [0,1)\), put

$$\begin{aligned} V(a, a') \!=\! a\wedge a' - aa' , \quad \widetilde{V}(a, b, a', b') \!=\! V(a, a') \!+\! V(b, b') - V(a, b') - V(b, a') \end{aligned}$$

and

$$\begin{aligned} \sigma _{p/q}^2(a,b)&= \widetilde{V}(a,b,a,b) + 2 \sum _{k=1}^\infty \frac{1}{(p q)^{k} } \widetilde{V}(\langle p^{k} a\rangle , \langle p^{k} b\rangle , \langle q^{k} a\rangle , \langle q^{k} b\rangle ). \end{aligned}$$
(4)

Here we list general properties that we use.

$$\begin{aligned} \widetilde{V}(a, b, a', b')= & {} \widetilde{V}(a', b', a, b) = - \widetilde{V}(b, a, a', b') = - \widetilde{V}(a, b, b', a'), \end{aligned}$$
(5)
$$\begin{aligned} 0\le & {} \widetilde{V}(0, b, 0, b') = V(b, b') \le V(b, b) \le 1/4 , \end{aligned}$$
(6)
$$\begin{aligned} \widetilde{V}(a, b, a, b)= & {} |b-a| - |b-a| ^2 = v(b-a) = v(a-b), \end{aligned}$$
(7)
$$\begin{aligned} \sigma ^2_{p/q}(0,a)= & {} V(a,a) +2\sum _{k=1}^\infty \frac{1}{(p q)^{k} } V(\langle p^k a\rangle , \langle q^k a\rangle ) . \end{aligned}$$
(8)

When \(\theta \) satisfies (1), \(\varSigma _\theta \) does not depend on r and is given by

$$\begin{aligned}&\varSigma _\theta = \varSigma _{p/q} = \sup _{0\le a'< a\le 1} \sigma _{p/q}(a',a), \quad \hbox {and}\nonumber \\&\quad \varSigma _\theta = \varSigma _{p/q} = \sup _{0\le a\le 1/2} \sigma _{p/q}(0,a) \quad \hbox {if}\quad p>0. \end{aligned}$$
(9)

Put \(b_i:= \frac{i}{p-q}\), \(c_1:= \frac{q-2}{2q}\), \(c_2 := \frac{p-3}{2p}\), \(c_3 := \frac{p-1}{2p}\), \(c_4 := b_{(p-q-1)/2} = \frac{(p-q-1)/2}{p-q}\), \(c_5 := \frac{q-1}{2q}\), \(c_6 := \frac{p-2}{2p}\), and \(c_7 := b_{(p-q-3)/2} = \frac{(p-q-3)/2}{p-q}\). When p and q are positive and satisfying \(p/q\ge 2\), one can verify \( c_1<c_2 < c_4 < c_3 \) and \(c_5 \le c_6 \le c_4\). By \(p=q\) mod \(p-q\), we have

$$\begin{aligned} \langle p^k b_i\rangle = \langle q^k b_i\rangle \quad \hbox {and}\quad V\left( \langle p^k b_i \rangle , \langle q^k b_i \rangle \right) = v(p^k b_i) = v(q^k b_i). \end{aligned}$$
(10)

Thanks to \(v(-x)= v(x)\), we have \(v(q^{m+nI} c_4) = v(\pm q^{m} c_4)=v(q^{m} c_4)\). Hence \(\sigma _{p/q}(0,c_4)\) equals to the left hand side of (2).

In the next two sections, we prove \( \varSigma _{p/q} = \sigma _{p/q}(0,c_4) \) in the case p is positive and p / q is large. By assuming this, we here prove \(\varSigma _{-p/q}= \varSigma _{p/q}\). In [6] we proved \(\varSigma _{-p/q} \le \varSigma _{p/q}\). If we find \(0\le \widehat{b}< \widetilde{b}\le 1\) with \(\sigma _{-p/q}(\widehat{b}, \widetilde{b}) = \sigma _{p/q}(0, c_4)=\varSigma _{p/q}\), we have the equality.

We put \( \widehat{b} = (1-c_4)p/({p+q})\) and \(\widetilde{b} = \widehat{b} + c_4\). It holds that \( \left\langle (-p)^{n} \widehat{b} \,\right\rangle =\left\langle q^{n} \widehat{b} \,\right\rangle \) and \(\left\langle (-p)^{n} \widetilde{b} \,\right\rangle =\left\langle q^{n} \widetilde{b} \, \right\rangle \) if n is even, and that \( \left\langle (-p)^{n} \widehat{b} \,\right\rangle =\left\langle q^{n} \widetilde{b} \,\right\rangle \) and \(\left\langle (-p)^{n} \widetilde{b} \,\right\rangle =\left\langle q^{n} \widehat{b} \,\right\rangle \) if n is odd. Actually, we have \((p+q)\widehat{b} =p-p c_4 = -p c_4 = -qc_4\) mod 1, which implies \(-p \widehat{b} = q\widetilde{b}\), \(-p\widetilde{b} = q\widehat{b}\) mod 1, and \((-p)^2 \widehat{b} = -pq\widetilde{b} = q^2 \widehat{b}\) mod 1, and so on. By noting (5), (7), and \( \left\langle \langle q^{n} \widetilde{b} \,\rangle - \langle q^{n} \widehat{b} \,\rangle \right\rangle = \langle q^{n} c_4\rangle \), we have

$$\begin{aligned} \widetilde{V}(\langle (-p)^{n} \widehat{b} \,\rangle , \langle (-p)^{n} \widetilde{b} \,\rangle , \langle q^{n} \widehat{b} \rangle , \langle q^{n} \widetilde{b}\rangle )= & {} - \widetilde{V}(\langle q^{n} \widehat{b} \,\rangle , \langle q^{n} \widetilde{b} \,\rangle , \langle q^{n} \widehat{b} \rangle , \langle q^{n} \widetilde{b}\rangle )\\= & {} -v(q^{n} c_4) \end{aligned}$$

for odd n, and

$$\begin{aligned} \widetilde{V}(\langle (-p)^{n} \widehat{b} \,\rangle , \langle (-p)^{n} \widetilde{b} \,\rangle , \langle q^{n} \widehat{b} \rangle , \langle q^{n} \widetilde{b}\rangle ) =v(q^{n} c_4) \end{aligned}$$

for even n, to have \(\sigma _{-p/q}(\widehat{b}, \widetilde{b}) = \sigma _{p/q}(0, c_4)\).

We prepare some inequalities to prove \(\varSigma _{p/q} = \sigma _{p/q}(0,c_4)\). We denote \(\sigma _{p/q}(0,a)\) simply by \(\sigma (a)\).

Put

$$\begin{aligned} X_N(a):= & {} V(a, a) + 2\sum _{n=1}^N \frac{1}{(pq)^n} V\left( \langle p^n a\rangle , \langle q^n a\rangle \right) , \quad Y_N(a) := 2\sum _{n=N+1}^\infty \frac{v(q^n a)}{(pq)^n},\\ T_N:= & {} 2\sum _{n=N+1}^\infty \frac{1}{4(pq)^n}, \end{aligned}$$

\(S_t(a):=2v(t^2a)/{(pq)^2}\), and \(Z(a) := V(a, a) + 2 v(qa)/{pq}\). Thanks to (6) and (10), we have

$$\begin{aligned}&V\left( \langle p^k a\rangle , \langle q^k a\rangle \right) \le v(q^k a), \quad V\left( \langle p^k a\rangle , \langle q^k a\rangle \right) \le v(p^k a),\\&\quad V\left( \langle p^k a\rangle , \langle q^k a\rangle \right) \le 1/4, \end{aligned}$$

and

$$\begin{aligned} \sigma ^2(a) \!\le \! W_j(a) \quad (1\le j\le 6), \quad \hbox {and}\quad W_1(b_i) \!=\! W_2(b_i) \!=\! \sigma ^2(b_i)\quad (0\le i\le p-q), \end{aligned}$$
(11)

where

$$\begin{aligned} W_1&:= X_1 + Y_1,&W_2&:= X_2 + Y_2,&W_3&:= X_1 + T_1,\\ W_4&:= Z + S_q + T_2,&W_5&:= Z + S_p + T_2,&W_6&:= Z + T_1. \end{aligned}$$

By \(\gcd (q, p-q)=1\), \(\langle p^k c_4\rangle = \langle q^k c_4\rangle \in \{b_1, \dots , b_{p-q-1}\}\) and \(v(b_i)\ge v(b_1)\), we have

$$\begin{aligned} \sigma _{}^2 (c_4) \ge Z(c_4) + 2\sum _{n=2}^\infty \frac{1}{(pq)^n}v(b_1) =:U. \end{aligned}$$

Note that the evaluation of U strongly depends on the parity of p, since \(\langle qc_4\rangle = qc_4 - (q-2)/2\) or \(\langle qc_4\rangle = qc_4 - (q-1)/2\) according as q is even or odd.

We denote the derivative \(\frac{d}{da}f\) of f by Df, the right derivative by \(D^+f\), and the left derivative by \(D^-f\).

3 Odd p and even q

Assume that q is even, and that p is odd and positive. We divide [0, 1 / 2) into subintervals \([ 0, c_1)\), \([ c_1, c_2)\), \([c_2, c_3)\), and \([c_3, 1/2)\), and prove \(\sigma ^2(a) \le \sigma ^2(c_4)\) on each.

3.1 \([c_2, c_3)\) part

We assume (3), \(A_1(p,q)>0\), and \(a\in [c_2, c_3)\). We have \(\langle pa\rangle = pa- (p-3)/2\) and \(\langle qa\rangle = qa - (q-2)/2\). Since \(\langle pa\rangle <\langle qa\rangle \) holds on \([c_2, c_4)\), and \(\langle pa\rangle \ge \langle qa\rangle \) on \([c_4, c_3)\), we can evaluate \(X_1\) as

$$\begin{aligned} X_1(a)&= {\left\{ \begin{array}{ll} -3a^2 +(3-3/p)a +3/2p-1/2 &{} a \in [c_2, c_4],\\ -3a^2 +(3-2/q-1/p)a-1/pq+1/q+1/2p-1/2 &{} a \in [ c_4, c_3), \end{array}\right. } \end{aligned}$$

and verify that \(D X_1(a)\) decreases on \([c_2, c_3)\). We also have \(|D v(q^n a)| \le q^n \) a.e. a, and therefore \( |D Y_1| \le 2/{p(p-1)} \) a.e. By combining these, we have

$$\begin{aligned} D W_1(a)> & {} D^- X_1(c_4) - 2/p(p-1)\\= & {} (3pq-2p-q)/{p(p-1)(p-2)} > 0 \quad \hbox { a.e. on }\quad (c_2, c_4], \end{aligned}$$

and

$$\begin{aligned} D W_1(a)< & {} D^+ X_1(c_4) + 2/p(p-1)\\= & {} -A_1(p,q)/p(p-1)(p-2) < 0 \quad \hbox { a.e. on }\quad [ c_4, c_3). \end{aligned}$$

Hence \( \sigma _{}^2(a) \le W_1(a) \le W_1(c_4) = \sigma _{}^2(c_4) \) for \(a\in [c_2, c_3)\). Here we note that functions appearing here are bounded and absolutely continuous, and the exceptional set of null measure for \(D W_1(a) > 0\) or \(D W_1(a) < 0\) does not harm the argument to show that \(c_4\) is the maximal point.

Here we prove \(A_1(p,q)>0\) by assuming \(p/q> 9/4\). Since \(2p^2 -(4q+2)p + (q^2-2q)\) is increasing in \(p\ge (9/4)q\), \(A_1(p,q)\) also. Because of \(A_1((9/4)q, q) = 3q^2(3q-28)/32>0\) if \(q\ge 10\), we see that \(A_1(p,q)>0\) if \(q\ge 10\) and \(p/q> 9/4\). Thanks to \(A_1(5, 2)> 0\), \(A_1(11, 4)>0\), \(A_1(17,6)>0\) and \(A_1(19,8)>0\), we see that \(A_1(p,q)>0\) if \(p/q> 9/4\).

We prove the case \(p/q=9/4\). Due to the above proof, we see that \(\sigma _{}^2(a) \le \sigma _{}^2(c_4)\) for \(a\in [c_2, c_4]\). Since we have \(T_1= \frac{1}{2520}\) and \(X_1\) is decreasing in \(a\ge c_4\), we have \(\sigma ^2(a) \le W_3(a) \le X_1(\frac{34}{81})+\frac{1}{2520} < \frac{222}{875}= \sigma ^2(c_4)\) on \([\frac{34}{81}, c_3)\). On \([c_4, \frac{33}{81})\), we have \(\langle 16 a\rangle \le \langle 81 a\rangle \) and see \(D X_2\) is decreasing and \(|D Y_2(a)| \le \frac{1}{324}\). Hence we have \(D W_2(a) \le D X_2(c_4) + \frac{1}{324}< 0\) and \(\sigma ^2(c_4) = W_2(c_4) \ge W_2(a)\ge \sigma ^2(a)\) on \([c_4, \frac{33}{81})\). Note that \(Y_2\le \frac{1}{90,720}\). On \([\frac{33}{81}, \frac{27}{65})\), by \(\langle 16 a\rangle \ge \langle 81 a\rangle \) we see that \(X_2\) equals to a quadratic function having axis at \(\frac{881}{2160}\). Hence \( \sigma ^2(a) \le X_2(\frac{881}{2160}) + \frac{1}{90,720}< \sigma ^2(c_4) \). On \([\frac{27}{65}, \frac{34}{81})\), by \(\langle 16 a\rangle < \langle 81 a\rangle \), \(X_2\) is decreasing. Hence \(\sigma ^2(a) \le X_2(\frac{27}{65})+ \frac{1}{90,720}< \sigma ^2(c_4)\) for \(a\in [\frac{27}{65}, \frac{34}{81})\).

3.2 \([c_3, 1/2)\) part

Let \(a\in [c_3, 1/2)\). We have \(\langle pa\rangle = pa-(p-1)/2\) and \(\langle qa\rangle = qa-(q-2)/2\). We see \(\langle qa\rangle - \langle pa\rangle = -(p-q)a + (p-q+1)/2 > 1/2\). Since \(W_3(a)\) maximizes at \(a_1:= (3p-1)/6p\), we have \( W_3(a) \le W_3(a_1) \). By

$$\begin{aligned} U- W_3(a_1) = A_2(p,q)/(12 p^2 q (p-q)^2 (p q - 1))> 0, \end{aligned}$$

we have \( \sigma _{}^2(a) < U_{} \) for \(a\in [c_3, 1/2)\).

We derive \(A_2(p,q)>0\) from \(p/q\ge 9/4\). Put \(\widehat{A}_2(p,q)=(8 q^2 - 6)p^2 +(- 16q^3+4q)p -q^4\). We see

$$\begin{aligned} A_2(p,q) = p\widehat{A}_2(p,q) + (24p^2-24qp-24p) + (10q^2p+q^3) > \widehat{A}_2(p,q). \end{aligned}$$

We see \( \widehat{A}_2(p,q)\) is increasing in p if \(p\ge 2q\). By \(\widehat{A}_2((9/4)q, q)= q^2(28q^2-171)/8>0\) (\(q\ge 4\)), and by \(\widehat{A}_2(5,2)>0\), the proof is over.

3.3 \([0, c_1)\) part

We consider on \([0, c_1)\). We assume \(q\ge 4\), since \(c_1=0\) otherwise. Since V(aa) increases on \([0, c_1)\) and \(W_4(a)-V(a,a)\) has period 1 / q, the first equality of

$$\begin{aligned} \sup _{a\in [0, c_1)} W_4(a) = \sup _{a\in [c_1-1/q, c_1)} W_4(a) = \sup _{a\in [c_1-1/q^2, c_1)} W_4(a) = W_4(c_1) < U \end{aligned}$$
(12)

holds. On \([c_1-1/q, c_1)\), we have \(\langle q a\rangle = qa-(q-4)/2\), and we see Z equals to a quadratic function having axis at \(a_2:=(2q+p-6)/(4q+2p)\). By \(a_2-c_1 = (p-q)/q(2q+p)>0\), we see that it is increasing on \([c_1-1/q, c_1)\). Since \(S_q(a)\) has period \(1/q^2\), we verified the second equality of (12). On \([c_1-1/q^2, c_1)\), we have \(\langle q^2 a\rangle = q^2 a-q(q-2)/2+1\). We see that \(W_4(a)\) equals to a quadratic function with axis \( a_3:=({2 q^2 + (2 p - 4) q + p^2 - 6 p - 2})/({4 q^2 + 4 p q + 2 p^2}) \). By

$$\begin{aligned} a_3-c_1\!=\! (p^2-pq-q)/(4 q^2 \!+\! 4 p q \!+\! 2 p^2)> p(p-2q)/(2 q^2 + 2 p q + 1 p^2)\ge 0, \end{aligned}$$

we have the third equality. The rest is proved by

$$\begin{aligned}&4 p^2 q^2 (p - q)^2 (p q - 1) (U_{} - W_4(c_1) )\\&\quad =4 qp^5 +(- 8 q^2 - 4)p^4 +(7 q^3 + 8 q)p^3 +(- 6 q^4 - 7 q^2 + 8 q - 2)p^2\\&\qquad +\,(6 q^3 - 8 q^2 -4 q)p -2q^2, \end{aligned}$$

by noting

$$\begin{aligned} 4qp^5-(8q^2+4)p^4 +2 p^3q^3\ge & {} 4qp^5-9q^2p^4 +2p^3q^3\\= & {} p^3q^3(4p/q-1)(p/q-2)\ge 0,\\ 5q^3p^3-6q^4p^2\ge & {} 0, \quad 8qp^3-7q^2p^2> 0, \quad (8q-2)p^2>0,\\ (5q^3-8q^2-4q)p> & {} 0, \quad q^3p-2q^2> 0. \end{aligned}$$

3.4 \([c_1, c_2)\) part

Considering on \([c_1, c_2)\), we have \(\langle qa\rangle = qa-(q-2)/2\). Since Z equals to a quadratic function with axis \(a_4:=(2q+p-2)/(4q+2p)\), and since \(a_4 - c_2 = (6q+p)/2p(2q+p)>0\), it is increasing on \([ c_1, c_2)\).

First, we consider the case when \(2q\le p\le \frac{3}{2} q^2 + q\) holds. Since \(S_p \) has period \(1/p^2\), and since

$$\begin{aligned} c_2 -1/p^2 -c_1 = (2p+q)(p-2q)/2p^2q\ge 0, \end{aligned}$$

we have the first equality of

$$\begin{aligned} \sup _{a\in [c_1, c_2)} W_5(a) = \sup _{a\in [c_2-1/p^2, c_2)} W_5(a) \le W_5(a_5) < U. \end{aligned}$$
(13)

On \([c_2-1/p^2, c_2)\), we have \(\langle p^2 a\rangle = p^2 a -p(p-3)/2+1\), and we see that \(W_5(a)\) equals to a quadratic function with axis \(a_5:=(2q^3 + ( p - 2) q^2 + 2 p^3 - 6 p^2 - 2p)/(4 q^3 + 2 p q^2 + 4 p^3)\), hence we have the third inequality. We have the rest by

$$\begin{aligned}&{4 p^2 q (p - q)^2 (p q - 1)(2q^3+pq^2+2p^3)}(U-W_5(a_5))\\&\quad =-4p^6 + (36 q^3 + 4 q^2 + 8 q +16)p^5 +(-79q^4 +16 q^3 - 40 q^2 \\&\qquad -\, 20 q -16)p^4+(44q^5 - 44 q^4 +79 q^3 -8 q^2 -2q)p^3+(-16q^6 +24q^5\\&\qquad -\,44 q^4+ 52 q^3 - 8 q^2 )p^2 +(16q^5 - 40q^4 - 10q^3)p - 4q^4> 0. \end{aligned}$$

Actually, when \(q\ge 4\), we see

$$\begin{aligned}&-4p^6 + (36q^3 + 4q^2 + 8q+16)p^5 -79q^4 p^4 + 16q^5p^3\\&\qquad \ge (36q^3 -2 q^2 )p^5 -79q^4 p^4 + 16q^5p^3\\&\qquad \ge \frac{71}{2} q^3 p^5 -79q^4 p^4 + 16q^5p^3\\&\qquad =\frac{1}{2}\left( \frac{p}{q}-2\right) \left( 71\frac{p}{q}-16\right) \ge 0,\\&\quad (16q^3 -40 q^2 -20q -16)p^4 \ge (16 - 10 - 5/4 -1/4)q^3p^4>0,\\&\quad (12q^5 -44q^4)p^3 \ge (12-11)q^5p^3>0, \quad 16q^5p^3 - 16q^6p^2> 0, \\&\quad (24q^5+52q^3-8q^2)p^2> 0,\\&\quad (79q^3-8q^2-2q)p^3-44q^4p^2 \ge (79-2-1/8)q^3p^3 -44q^4p^2> 0,\\&\quad (16q^5-40q^4-10q^3)p -4q^4 \ge (16-10-5/8)q^5p-4q^4> 0. \end{aligned}$$

When \(q=2\), and \(p=5\) or 7, one can verify the above inequality.

Next, we consider the case \(p> \frac{3}{2} q^2 + q\). We have already seen that Z and \(W_6\) are increasing on \([c_1, c_2)\). Note that \(p/q > \frac{3}{2} q + 1 \ge 4\) and \((c_2 -1/p) - c_1 = (p/q-5/2)/p> 0\). We can verify

$$\begin{aligned}&(U-W_6(c_2-1/p))(4p^3q(p-q)^2(pq-1))\\&\quad =(8q^2 -2) p^4 + (34q^3 -4 q + 8) p^3 +(-95q^4 -36q^2 -8q -8)p^2\\&\qquad +\,(50 q^5 +95q^3)p -50q^4> 0 \end{aligned}$$

by \(8p^3 -(8q+8)p^2 \ge 8p^3 -12qp^2>0\) and

$$\begin{aligned}&(8q^2 -2 )p^4 + (34q^3-4q)p^3 +(-95q^4-36q^2)p^2 + 50q^4p\\&\quad > \frac{15}{2} q^2p^4 + 33q^3p^3 -104q^4p^2 + 50q^5p = q^5p\left( \frac{15}{2}\left( \frac{p}{q}\right) ^3 + 33\left( \frac{p}{q}\right) ^2\right. \\&\qquad \left. -104\left( \frac{p}{q}\right) +50\right) =:q^5p\cdot g\left( \frac{p}{q}\right) > 0 \end{aligned}$$

since \(g'(t)>0\) for \(t\ge 2\) and \(g(2)>0\). Hence we see

$$\begin{aligned} \sigma ^2(a) \le W_6 (a) \le W_6(c_2-1/p) \le U\quad (a\in [ c_1, c_2-1/p]). \end{aligned}$$

We consider on \([ c_2-1/p, c_2)\). We have \(\langle pa \rangle = pa-(p-5)/2\), \(\langle qa \rangle = qa-(q-2)/2\), and can see that \(\langle pa \rangle < \langle qa \rangle \) on \([ c_2-1/p, c_7)\) and \(\langle pa \rangle \ge \langle qa \rangle \) on \([ c_7, c_2)\). By recalling the bound \(|D Y_1| \le 2/p(p-1)\), we can verify that \(D X_1\) is decreasing on \([ c_2-1/p, c_2)\),

$$\begin{aligned} D W_1(a)\ge & {} D^- X_1(c_7)-2/{p(p-1)} \\= & {} {(4p^2 +(5q-6)p -3q)}/{p(p-q)(p-1)}> 0, \end{aligned}$$

on \([ c_2-1/p, c_7)\), and

$$\begin{aligned} D W_1 \le D^+ X_1(c_7) +2/{p(p-1)}= & {} (-2p^3 + (8q +2)p^2\\&+\,(3q^2-6q)p -5q^2)/{p(p-q)(p-1)}< 0 \end{aligned}$$

on \([ c_7, c_2)\). Actually, the first inequality is clear and the second is proved by

$$\begin{aligned}&-2p^3 + (8q +2)p^2 +3q^2p \le -2p^3 + 9q p^2 +3q^2p\\&\quad = pq^2\left( -2\left( \frac{p}{q} \right) ^2 + 9 \left( \frac{p}{q}\right) +3\right) < 0 \end{aligned}$$

by \(\frac{p}{q} \ge 7\) if \(q\ge 4\). In case \(q=2\), we have

$$\begin{aligned} -2p^3 + (8q +2)p^2 +(3q^2-6q)p -5q^2= -2(p+1)(p^2 -10p +10)< 0 \end{aligned}$$

for \(p\ge 9\). Hence we see the second inequality of

$$\begin{aligned} \sigma ^2(a) \le W_1(a) \le W_1(c_7)\!=\! \sigma ^2(c_7) \le W_4(c_7) < \widetilde{U} < \sigma ^2(c_4) \quad (a\in [ c_2-1/p, c_2)). \end{aligned}$$

Put \( \widetilde{U}:= Z(c_4) + S_q(c_4) < \sigma ^2(c_4) \). Because of \(0< q^2/2(p-q)< 3q^2/2(p-q)< 1\),

$$\begin{aligned}&q^2 c_4 = (q^2/2-1)+ (1-q^2/2(p-q)), \quad \hbox {and}\\&\quad q^2 c_7 = (q^2/2-1)+ (1-3q^2/2(p-q)), \end{aligned}$$

we see \(\langle q^2 c_4\rangle = 1-q^2/2(p-q)\) and \(\langle q^2 c_7\rangle = 1-3q^2/2(p-q)\). Hence we can calculate \(S_q(c_4)\) and \(S_q(c_7)\), and can verify the rest by

$$\begin{aligned}&(\widetilde{U} - W_4(c_7)) (2p^2q^2 (p-q)^2 (pq-1))\\&\quad = (12q^4-4q^3-1) p^2 + (8q^5 + 4q^4 -12 q^3 +4q^2 + 2q)p -8q^4 -4q^3 -q^2\\&\quad \ge 9q^4p^2 + 7q^5 p -11 q^4 > 0 . \end{aligned}$$

4 Even p and odd q

Assume that q is odd and p is even and positive. We may assume \(q\ge 3\).

4.1 \([ c_6, 1/2)\) part

We consider on \([ c_6, 1/2)\). We have \(\langle pa\rangle = pa-(p-2)/2\), and by \(c_5\le c_6\), \(\langle qa\rangle = qa - (q-1)/2\). Since \(\langle pa\rangle < \langle qa\rangle \) holds on \([ c_6, c_4)\), and \(\langle pa\rangle \ge \langle qa\rangle \) on \([ c_4, 1/2)\), we see that \(D X_1\) is decreasing on \([ c_6, 1/2)\). Recalling \(|D Y_1(a) | \le 2/p(p-1) \), we have

$$\begin{aligned} D W_1(a) \ge D^- X_1(c_4) - 2/{p(p-1)} = ({2q^2 - 2q +p^2 - p})/{(p-1)q(p-q)}\!>\! 0 \end{aligned}$$

on \([c_6, c_4)\), and

$$\begin{aligned} D W_1(a) \le D^+ X_1(c_4) + 2/{p(p-1)} = {-A_3(p,q)}/{(p-1)pq(p-q)}<0 \end{aligned}$$

on \([c_4, 1/2)\). Hence \( W_1(a) \le W_1(c_4)= \sigma ^2(c_4) \) for \(a\in [c_6, 1/2)\).

We derive \(A_3(p,q)>0\) from \(p/q\ge 4\). Because of \(p\ge 4q\) and p and q are relatively prime, we see \(p> 4q\) or \(p\ge 4q+2\). Hence we have \(A_3(p,q)= p^2(p-4q-1)+2pq+2q^2> 0\).

4.2 \([0, c_5)\) part

We consider on \([0, c_5)\). The condition (3) implies \(p\ge 2q+2\). Since V(aa) is increasing on \([0, c_5)\) and \(W_4(a) - V(a,a)\) has period 1 / q, we have the first equality of

$$\begin{aligned} \sup _{a\in [0, c_5)} W_4(a) =\sup _{a\in [c_5-1/q, c_5)} W_4(a) =\sup _{a\in [c_5-1/q^2, c_5)} W_4(a) = W_4(c_5)< U.\quad \end{aligned}$$
(14)

On \([c_5-1/q, c_5)\), we have \(\langle qa\rangle = qa -(q-3)/2\) and we see that Z equals to a quadratic function having axis at \(a_6:=({p+ 2q-4})/({2p+4q}) \). Because of

$$\begin{aligned} a_6 - c_5 = ({p-2q})/({2q(2q+p)})> 0, \end{aligned}$$

it is increasing on \([c_5-1/q, c_5)\). Since \(S_q\) has period \(1/q^2\), we have the second equality of (14). On \([c_5-1/q^2, c_5)\), we have \(\langle q^2a\rangle = q^2a -q(q-1)/2+1\) and we see that \(W_4(a) \) equals to a quadratic function having axis at \( a_7 := ({2 q^2 + (2 p - 2) q + p^2 - 4 p - 2})/({4 q^2 + 4 p q + 2 p^2}) \). Because of

$$\begin{aligned} a_7- c_5 = ((p+1)(p-2q-1)+ 1)/({2 q (2 q^2 + 2 p q + p^2 ))} > 0, \end{aligned}$$

\(W_4(a)\) is increasing on \([c_5-1/q^2, c_5)\) and the third equality of (14) is proved. The rest is by

$$\begin{aligned}&(U- W_4(c_5))({4p^2q^2(p-q)^2(pq-1)}) \\&\quad =p(p-2q)\left( p(pq-1)(p+2q) + 4q+2\right) + 4(q-2)p^2 +2(2p^2 -q^2) >0. \end{aligned}$$

4.3 \([c_5, c_6)\) part

On \([c_5, c_6)\), we have \(\langle qa \rangle = qa-(q-1)/2\) and we see that Z equals to a quadratic function having axis at 1 / 2. Hence it is increasing on \([c_5, c_6)\). Since \(S_p\) has period \(1/p^2\), we have the first equality of

$$\begin{aligned} \sup _{a\in [c_5, c_6)} W_5(a) =\sup _{a\in [(c_6-1/p^2)\vee c_5, c_6)} W_5(a) \le W_5(a_8)< U. \end{aligned}$$
(15)

On \([(c_6-1/p^2)\vee c_5, c_6)\), by \(\langle p^2a \rangle = p^2 a - p(p-2)/2+1\) we see that \(W_5(a)\) is a quadratic function having axis at \( a_8 := ({2 q^3 + p q^2 + 2 p^3 - 4 p^2 - 2 p}) /(4 q^3 + 2 p q^3+ 4 p^3)\). Hence we have the middle of (15). Rest is by

$$\begin{aligned} U - W_5(a_8) =A_4(p,q)/4 p^2 q (q - p)^2 (p q - 1) (2 q^3 + p q^2 + 2 p^3 )> 0. \end{aligned}$$

Finally, we prove \(A_4(p,q)>0\) by assuming

$$\begin{aligned} \frac{p}{q}\ge a_9:= & {} \left( \frac{6^{-3/2} \sqrt{1019}}{9} + \frac{511}{1458}\right) ^{1/3} + \frac{65}{162}\left( \frac{6^{-3/2} \sqrt{1019}}{9} + \frac{511}{1458}\right) ^{-1/3} \\&+\,\frac{8}{9} =2.206\dots . \end{aligned}$$

We decompose as \(3A_4(p,q)=h_1 + \cdots + h_7\). Here

$$\begin{aligned} h_1= & {} (3q^2-2)(p\!+\!2q)p^2q^3\left( 6\left( \frac{p}{q}\right) ^3\!-\!16\left( \frac{p}{q}\right) ^2 \!+\! 7\left( \frac{p}{q}\right) \!-\!2\right) \!\ge \! 0 \quad \hbox { if }\quad \frac{p}{q}\ge a_9,\\ {h_2}= & {} {(24q^2-2q)p^5 -50q^2p^4-72q^4p^3+48q^5p^2}\\\ge & {} {q^5p^2}\left( \frac{70}{3} \left( \frac{p}{q}\right) ^3-\frac{50}{3} \left( \frac{p}{q}\right) ^2 -72\left( \frac{p}{q}\right) +48\right) >0 \end{aligned}$$

since the last cubic function in p / q is increasing for \(p/q\ge 2\) and equals to 24 at \(p/q=2\),

$$\begin{aligned} h_3= & {} 48p^5-(72q+48)p^4 \ge 48p^5-88qp^4> 0,\\ h_4= & {} 99q^3p^3-44q^4p^2>0,\\ h_5= & {} (24q^2-6q)p^3> 0,\\ h_6= & {} (96q^3-24q^2)p^2 -(96q^4+30q^3)p > 88q^3p^2-106q^4p> 0,\\ h_7= & {} 12q^4(pq-1)> 0. \end{aligned}$$