Let
(
a
k
)
k
∈
N
(a_k)_{k\in \mathbb N}
be an increasing sequence of positive integers satisfying the Hadamard gap condition
a
k
+
1
/
a
k
>
q
>
1
a_{k+1}/a_k> q >1
for all
k
∈
N
k\in \mathbb N
, and let
S
n
(
ω
)
=
∑
k
=
1
n
cos
(
2
π
a
k
ω
)
,
n
∈
N
,
ω
∈
[
0
,
1
]
.
\begin{equation*} S_n(\omega ) = \sum _{k=1}^n \cos (2\pi a_k \omega ), \qquad n\in \mathbb N, \; \omega \in [0,1]. \end{equation*}
Then
S
n
S_n
is called a lacunary trigonometric sum, and can be viewed as a random variable defined on the probability space
Ω
=
[
0
,
1
]
\Omega = [0,1]
endowed with Lebesgue measure. Lacunary sums are known to exhibit several properties that are typical for sums of independent random variables. For example, a central limit theorem for
(
S
n
)
n
∈
N
(S_n)_{n\in \mathbb {N}}
has been obtained by Salem and Zygmund, while a law of the iterated logarithm is due to Erdős and Gál. In this paper we study large deviation principles for lacunary sums. Specifically, under the large gap condition
a
k
+
1
/
a
k
→
∞
a_{k+1}/a_k \to \infty
, we prove that the sequence
(
S
n
/
n
)
n
∈
N
(S_n/n)_{n \in \mathbb {N}}
does indeed satisfy a large deviation principle with speed
n
n
and the same rate function
I
~
\widetilde {I}
as for sums of independent random variables with the arcsine distribution. On the other hand, we show that the large deviation principle may fail to hold when we only assume the Hadamard gap condition. However, we show that in the special case when
a
k
=
q
k
a_k= q^k
for some
q
∈
{
2
,
3
,
…
}
q\in \{2,3,\ldots \}
,
(
S
n
/
n
)
n
∈
N
(S_n/n)_{n \in \mathbb {N}}
satisfies a large deviation principle (with speed
n
n
) and a rate function
I
q
I_q
that is different from
I
~
\widetilde {I}
, and describe an algorithm to compute an arbitrary number of terms in the Taylor expansion of
I
q
I_q
. In addition, we also prove that
I
q
I_q
converges pointwise to
I
~
\widetilde I
as
q
→
∞
q\to \infty
. Furthermore, we construct a random perturbation
(
a
k
)
k
∈
N
(a_k)_{k \in \mathbb {N}}
of the sequence
(
2
k
)
k
∈
N
(2^k)_{k \in \mathbb {N}}
for which
a
k
+
1
/
a
k
→
2
a_{k+1}/a_k \to 2
as
k
→
∞
k\to \infty
, but for which at the same time
(
S
n
/
n
)
n
∈
N
(S_n/n)_{n \in \mathbb {N}}
satisfies a large deviation principle with the same rate function
I
~
\widetilde {I}
as in the independent case, which is surprisingly different from the rate function
I
2
I_2
one might naïvely expect. We relate this fact to the number of solutions of certain Diophantine equations. Together, these results show that large deviation principles for lacunary trigonometric sums are very sensitive to the arithmetic properties of the sequence
(
a
k
)
k
∈
N
(a_k)_{k\in \mathbb N}
. This is particularly noteworthy since no such arithmetic effects are visible in the central limit theorem or in the law of the iterated logarithm for lacunary trigonometric sums. Our proofs use a combination of tools from probability theory, harmonic analysis, and dynamical systems.