/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/importFormalConjecturesUtil
Rudin's conjecture on squares in arithmetic progressions
$Q(N) = \max Q(N; q, a)$, the largest number of perfect squares occurring among the first
$N$ terms of any non-trivial arithmetic progression. The supremum is over a set of naturals that
is bounded above by $N$ (each progression has only $N$ terms), so it is attained.
Sanity check pinning Q to a concrete value: among the first 6 terms of 24 n + 1, namely
1, 25, 49, 73, 97, 121, exactly four are perfect squares (1, 25, 49, 121), so
Q 6 24 1 = 4. This validates the definition of Q and matches the claim that 24 n + 1 is the
extremal progression.
Rudin's conjecture. The maximal number of squares among the first $N$ terms of a non-trivial
arithmetic progression grows at most like $\sqrt{N}$:
$$Q(N) = O(\sqrt{N}).$$
The strongest form of Rudin's conjecture also asserts uniqueness: for $N \ge 6$, any non-trivial
arithmetic progression attaining the maximum $Q(N)$ has common difference $24$. (Its initial term
is then forced by $\gcd(24, a) = 1$; the progression $24n + 1$ is the canonical representative.)