purewhite42/putnambench_solving huggingface dataset:
Problem: Call a subset $S$ of $\{1, 2, \dots, n\}$ \emph{mediocre} if it has the following property: Whenever $a$ and $b$ are elements of $S$ whose average is an integer, that average is also an element of $S$. Let $A(n)$ be the number of mediocre subsets of $\{1,2,\dots,n\}$. [For instance, every subset of $\{1,2,3\}$ except $\{1,3\}$ is mediocre, so $A(3) = 7$.] Find all positive integers $n$ such that $A(n+2) - 2A(n+1) + A(n) = 1$.

Answer: {n : ℤ | ∃ k ≥ 1, n = 2 ^ k - 1}

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Independent variables:
Hypotheses:
t: ℤ → Set ℤ → Prop
name: mediocre
t: ∀ n S, mediocre n S ↔ (S ⊆ Icc 1 n) ∧ ∀ a ∈ S, ∀ b ∈ S, 2 ∣ a + b → (a + b) / 2 ∈ S
name: hmediocre
t: ℤ → ℤ
name: A
t: A = fun n ↦ ({S : Set ℤ | mediocre n S}.ncard : ℤ)
name: hA
Conclusion:
({n : ℤ | n > 0 ∧ A (n + 2) - 2 * A (n + 1) + A n = 1} = answer)
Formal answer (type: Set ℤ):
answer = ({n : ℤ | ∃ k ≥ (1 : ℕ), n = (((2 : ℤ) ^ k : ℤ) - (1 : ℤ) : ℤ)} : Set ℤ)
Problem: Say that a polynomial with real coefficients in two variables, $x,y$, is \emph{balanced} if the average value of the polynomial on each circle centered at the origin is $0$. The balanced polynomials of degree at most $2009$ form a vector space $V$ over $\mathbb{R}$. Find the dimension of $V$.

Answer: 2020050

Lean 4 formalization:
open intervalIntegral MvPolynomial Real
Independent variables:
Hypotheses:
t: MvPolynomial (Fin 2) ℝ → Prop
name: IsBalanced
t: ∀ P, IsBalanced P ↔ ∀ r > 0,
      (∫ t in (0 : ℝ)..(2 * π), eval ![r * cos t, r * sin t] P) / (2 * π * r) = 0
name: IsBalanced_def
t: Submodule ℝ (MvPolynomial (Fin 2) ℝ)
name: V
t: ∀ P, P ∈ V ↔ IsBalanced P ∧ P.totalDegree ≤ 2009
name: V_def
Conclusion:
(Module.rank ℝ V = answer)
Formal answer (type: ℕ):
answer = (2020050 : ℕ)
Problem: Given a positive integer $n$, what is the largest $k$ such that the numbers $1,2,\dots,n$ can be put into $k$ boxes so that the sum of the numbers in each box is the same? [When $n=8$, the example $\{1,2,3,6\},\{4,8\},\{5,7\}$ shows that the largest $k$ is \emph{at least} $3$.]

Answer: the ceiling of n/2

Lean 4 formalization:
Independent variables:
t: ℕ
name: n
Hypotheses:
t: ℕ → Prop
name: kboxes
t: n > 0
name: npos
t: ∀ k : ℕ, kboxes k =
  (∃ boxes : Finset.Icc 1 n → Fin k, ∀ i j : Fin k,
    ∑ x in Finset.univ.filter (boxes · = i), (x : ℕ) =
    ∑ x in Finset.univ.filter (boxes · = j), (x : ℕ))
name: hkboxes
Conclusion:
(IsGreatest kboxes (answer n))
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => (⌈((↑n : ℝ) / (2 : ℝ) : ℝ)⌉₊ : ℕ)
Problem: Find all differentiable functions $f:\mathbb{R} \to \mathbb{R}$ such that
\[
f'(x) = \frac{f(x+n)-f(x)}{n}
\]
for all real numbers $x$ and all positive integers $n$.

Answer: {f : ℝ → ℝ | ∃ c d : ℝ, ∀ x : ℝ, f x = c*x + d}

Lean 4 formalization:
Independent variables:
Hypotheses:
Conclusion:
({f : ℝ → ℝ | Differentiable ℝ f ∧
∀ x : ℝ, ∀ n : ℤ, n > 0 → deriv f x = (f (x + n) - f x)/n} = answer)
Formal answer (type: Set (ℝ → ℝ)):
answer = ({f : ℝ → ℝ | ∃ (c : ℝ) (d : ℝ), ∀ (x : ℝ), (f x : ℝ) = ((c * x : ℝ) + d : ℝ)} : Set (ℝ → ℝ))
Problem: Is there an infinite sequence of real numbers $a_1, a_2, a_3, \dots$ such that \[ a_1^m + a_2^m + a_3^m + \cdots = m \] for every positive integer $m$?

Answer: False

Lean 4 formalization:
open Filter Topology Set
Independent variables:
Hypotheses:
Conclusion:
(answer ↔ (∃ a : ℕ → ℝ, ∀ m : ℕ, m > 0 → ∑' i : ℕ, (a i)^m = m))
Formal answer (type: Prop):
answer = False
Problem: Given that $A$, $B$, and $C$ are noncollinear points in the plane with integer coordinates such that the distances $AB$, $AC$, and $BC$ are integers, what is the smallest possible value of $AB$?

Answer: 3

Lean 4 formalization:
open Filter Topology Set
Independent variables:
Hypotheses:
t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCintcoords
t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCintdists
t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCall
t: ∀ A B C, ABCintcoords A B C ↔ (∀ i : Fin 2, A i = round (A i) ∧ B i = round (B i) ∧ C i = round (C i))
name: hABCintcoords
t: ∀ A B C, ABCintdists A B C ↔ (dist A B = round (dist A B) ∧ dist A C = round (dist A C) ∧ dist B C = round (dist B C))
name: hABCintdists
t: ∀ A B C, ABCall A B C ↔ (¬Collinear ℝ {A, B, C} ∧ ABCintcoords A B C ∧ ABCintdists A B C)
name: hABCall
Conclusion:
(IsLeast {y | ∃ A B C, ABCall A B C ∧ y = dist A B} answer)
Formal answer (type: ℕ):
answer = (3 : ℕ)
Problem: There are $2010$ boxes labeled $B_1, B_2, \dots, B_{2010}$, and $2010n$ balls have been distributed among them, for some positive integer $n$. You may redistribute the balls by a sequence of moves, each of which consists of choosing an $i$ and moving \emph{exactly} $i$ balls from box $B_i$ into any one other box. For which values of $n$ is it possible to reach the distribution with exactly $n$ balls in each box, regardless of the initial distribution of balls?

Answer: {1005}

Lean 4 formalization:
open Filter Topology Set
Independent variables:
Hypotheses:
t: ℕ
name: n
t: n > 0
name: hn
t: (ℕ → Fin 2010 → ℕ) → ℕ → Prop
name: trans
t: ∀ P T, trans P T ↔ ∀ t : ℕ, t < T → ∃ i j,
            i ≠ j ∧
            P t i ≥ i.1 + 1 ∧ P (t + 1) i = P t i - (i.1 + 1) ∧ P (t + 1) j = P t j + (i.1 + 1) ∧
            ∀ k : Fin 2010, k ≠ i → k ≠ j → P (t + 1) k = P t k
name: htrans
Conclusion:
((∀ B, ∑ i, B i = 2010 * n → ∃ᵉ (P) (T), P 0 = B ∧ trans P T ∧ ∀ i, P T i = n) ↔ n ∈ answer)
Formal answer (type: Set ℕ):
answer = ({(1005 : ℕ)} : Set ℕ)
Problem: Find all pairs of polynomials $p(x)$ and $q(x)$ with real coefficients for which $p(x)q(x+1)-p(x+1)q(x)=1$.

Answer: {(p, q) : Polynomial ℝ × Polynomial ℝ | p.degree ≤ 1 ∧ q.degree ≤ 1 ∧ p.coeff 0 * q.coeff 1 - p.coeff 1 * q.coeff 0 = 1}

Lean 4 formalization:
open Filter Topology Set
Independent variables:
t: Polynomial ℝ
name: p
t: Polynomial ℝ
name: q
Hypotheses:
Conclusion:
((∀ x : ℝ, p.eval x * q.eval (x + 1) - p.eval (x + 1) * q.eval x = 1) ↔ (p, q) ∈ answer)
Formal answer (type: Set (Polynomial ℝ × Polynomial ℝ)):
answer =
  ({((p, q) : Polynomial ℝ × Polynomial ℝ) : Polynomial ℝ × Polynomial ℝ |
      (p.degree : WithBot ℕ) ≤ (1 : WithBot ℕ) ∧
        (q.degree : WithBot ℕ) ≤ (1 : WithBot ℕ) ∧
          (((p.coeff (0 : ℕ) : ℝ) * (q.coeff (1 : ℕ) : ℝ) : ℝ) - ((p.coeff (1 : ℕ) : ℝ) * (q.coeff (0 : ℕ) : ℝ) : ℝ) :
              ℝ) =
            (1 : ℝ)} :
    Set (Polynomial ℝ × Polynomial ℝ))
Problem: Is there a strictly increasing function $f: \mathbb{R} \to \mathbb{R}$ such that $f'(x) = f(f(x))$ for all $x$?

Answer: False

Lean 4 formalization:
open Filter Topology Set
Independent variables:
Hypotheses:
Conclusion:
((∃ f : ℝ → ℝ, StrictMono f ∧ Differentiable ℝ f ∧ (∀ x : ℝ, deriv f x = f (f x))) ↔ answer)
Formal answer (type: Prop):
answer = False
Problem: Define a \emph{growing spiral} in the plane to be a sequence of points with integer coordinates $P_0=(0,0),P_1,\dots,P_n$ such that $n \geq 2$ and:
\begin{itemize}
\item the directed line segments $P_0P_1,P_1P_2,\dots,P_{n-1}P_n$ are in the successive coordinate directions east (for $P_0P_1$), north, west, south, east, etc.;
\item the lengths of these line segments are positive and strictly increasing.
\end{itemize}
How many of the points $(x,y)$ with integer coordinates $0 \leq x \leq 2011,0 \leq y \leq 2011$ \emph{cannot} be the last point, $P_n$ of any growing spiral?

Answer: 10053

Lean 4 formalization:
Independent variables:
Hypotheses:
t: List (Fin 2 → ℤ) → Prop
name: IsSpiral
t: ∀ P, IsSpiral P ↔ P.length ≥ 3 ∧ P[0]! = 0 ∧
  (∃ l : Fin (P.length - 1) → ℕ, l > 0 ∧ StrictMono l ∧ (∀ i : Fin (P.length - 1),
    (i.1 % 4 = 0 → (P[i] 0 + l i = P[i.1 + 1]! 0 ∧ P[i] 1 = P[i.1 + 1]! 1)) ∧
    (i.1 % 4 = 1 → (P[i] 0 = P[i.1 + 1]! 0 ∧ P[i] 1 + l i = P[i.1 + 1]! 1)) ∧
    (i.1 % 4 = 2 → (P[i] 0 - l i = P[i.1 + 1]! 0 ∧ P[i] 1 = P[i.1 + 1]! 1)) ∧
    (i.1 % 4 = 3 → (P[i] 0 = P[i.1 + 1]! 0 ∧ P[i] 1 - l i = P[i.1 + 1]! 1))))
name: IsSpiral_def
Conclusion:
({p | 0 ≤ p 0 ∧ p 0 ≤ 2011 ∧ 0 ≤ p 1 ∧ p 1 ≤ 2011 ∧ ¬∃ spiral, IsSpiral spiral ∧ spiral.getLast! = p}.encard = answer)
Formal answer (type: ℕ):
answer = (10053 : ℕ)
Problem: Let $a_1,a_2,\dots$ and $b_1,b_2,\dots$ be sequences of positive real numbers such that $a_1 = b_1 = 1$ and $b_n = b_{n-1} a_n - 2$ for$n=2,3,\dots$. Assume that the sequence $(b_j)$ is bounded. Prove tha \[ S = \sum_{n=1}^\infty \frac{1}{a_1...a_n} \] converges, and evaluate $S$.

Answer: 3/2

Lean 4 formalization:
open Topology Filter
Independent variables:
Hypotheses:
t: ℕ → ℝ
name: a
t: ℕ → ℝ
name: b
t: ∀ n : ℕ, a n > 0 ∧ b n > 0
name: habn
t: a 0 = 1 ∧ b 0 = 1
name: hab1
t: ∀ n ≥ 1, b n = b (n-1) * a n - 2
name: hb
t: ∃ B : ℝ, ∀ n : ℕ, |b n| ≤ B
name: hbnd
Conclusion:
(Tendsto (fun n => ∑ i : Fin n, 1/(∏ j : Fin (i + 1), (a j))) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (3 / 2 : ℝ)
Problem: Find a real number $c$ and a positive number $L$ for which $\lim_{r \to \infty} \frac{r^c \int_0^{\pi/2} x^r\sin x\,dx}{\int_0^{\pi/2} x^r\cos x\,dx}=L$.

Answer: (-1, 2 / π)

Lean 4 formalization:
open Topology Filter
Independent variables:
Hypotheses:
t: ℝ
name: c
t: ℝ
name: L
t: L > 0
name: h_L_pos
t: Tendsto (fun r : ℝ => (r ^ c * ∫ x in Set.Ioo 0 (Real.pi / 2), x ^ r * Real.sin x) / (∫ x in Set.Ioo 0 (Real.pi / 2), x ^ r * Real.cos x)) atTop (𝓝 L)
name: h_limit
Conclusion:
(answer = (c, L))
Formal answer (type: ℝ × ℝ):
answer = (((-1 : ℝ), ((2 : ℝ) / (Real.pi : ℝ) : ℝ)) : ℝ × ℝ)
Problem: For which positive integers $n$ is there an $n \times n$ matrix with integer entries such that every dot product of a row with itself is even, while every dot product of two different rows is odd?

Answer: the set of odd positive integers

Lean 4 formalization:
open Topology Filter Matrix
Independent variables:
t: ℕ
name: n
Hypotheses:
t: ℕ → Prop
name: nmat
t: ∀ n, nmat n ↔
      ∃ A : Matrix (Fin n) (Fin n) ℤ,
        (∀ r, Even ((A r) ⬝ᵥ (A r))) ∧
        Pairwise fun r1 r2 ↦ Odd ((A r1) ⬝ᵥ (A r2))
name: hnmat
t: 0 < n
name: npos
Conclusion:
(nmat n ↔ n ∈ answer)
Formal answer (type: Set ℕ):
answer = ({n : ℕ | Odd n} : Set ℕ)
Problem: Let $S$ be the set of all ordered triples $(p,q,r)$ of prime numbers for which at least one rational number $x$ satisfies $px^2+qx+r=0$. Which primes appear in seven or more elements of $S$?

Answer: {2, 5}

Lean 4 formalization:
open Topology Filter Matrix
Independent variables:
Hypotheses:
t: Set (Fin 3 → ℕ)
name: S
t: ℕ
name: t
t: S = {s : Fin 3 → ℕ | (s 0).Prime ∧ (s 1).Prime ∧ (s 2).Prime ∧ ∃ x : ℚ, (s 0) * x ^ 2 + (s 1) * x + (s 2) = 0}
name: hS
Conclusion:
((t.Prime ∧ ({s ∈ S | ∃ i : Fin 3, s i = t}.encard ≥ 7)) ↔ t ∈ answer)
Formal answer (type: Set ℕ):
answer = (Insert.insert (2 : ℕ) ({(5 : ℕ)} : Set ℕ) : Set ℕ)
Problem: Let $f$ and $g$ be (real-valued) functions defined on an open interval containing $0$, with $g$ nonzero and continuous at $0$. If $fg$ and $f/g$ are differentiable at $0$, must $f$ be differentiable at $0$?

Answer: True

Lean 4 formalization:
open Topology Filter Matrix
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
t: ℝ → ℝ
name: g
t: g 0 ≠ 0
name: h_g0
t: ContinuousAt g 0
name: h_cont
t: DifferentiableAt ℝ (fun x ↦ f x * g x) 0
name: h_diff_fg
t: DifferentiableAt ℝ (fun x ↦ f x / g x) 0
name: h_diff_f_div_g
Conclusion:
(DifferentiableAt ℝ f 0 ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Let $f: [-1, 1] \to \mathbb{R}$ be a continuous function such that
\begin{itemize}
\item[(i)]
$f(x) = \frac{2-x^2}{2} f \left( \frac{x^2}{2-x^2} \right)$ for every $x$ in $[-1, 1]$,
\item[(ii)]
$f(0) = 1$, and
\item[(iii)]
$\lim_{x \to 1^-} \frac{f(x)}{\sqrt{1-x}}$ exists and is finite.
\end{itemize}
Prove that $f$ is unique, and express $f(x)$ in closed form.

Answer: $f(x) = \sqrt{1 - x^2}$

Lean 4 formalization:
open Matrix Function
Independent variables:
Hypotheses:
t: Set ℝ
name: S
t: S = Set.Icc (-1 : ℝ) 1
name: hS
t: (ℝ → ℝ) → Prop
name: fsat
t: fsat = fun f : ℝ → ℝ => ContinuousOn f S ∧
(∀ x ∈ S, f x = ((2 - x^2)/2)*f (x^2/(2 - x^2))) ∧ f 0 = 1 ∧
(∃ y : ℝ, leftLim (fun x : ℝ => (f x)/Real.sqrt (1 - x)) 1 = y)
name: hfsat
Conclusion:
(fsat answer ∧ ∀ f : ℝ → ℝ, fsat f → ∀ x ∈ S, f x = answer x)
Formal answer (type: ℝ → ℝ):
answer = fun (x : ℝ) => (√((1 : ℝ) - (x ^ (2 : ℕ) : ℝ) : ℝ) : ℝ)
Problem: Let $\FF_p$ denote the field of integers modulo a prime $p$, and let $n$ be a positive integer. Let $v$ be a fixed vector in $\FF_p^n$, let $M$ be an $n \times n$ matrix with entries of $\FF_p$, and define $G: \FF_p^n \to \FF_p^n$ by $G(x) = v + Mx$. Let $G^{(k)}$ denote the $k$-fold composition of $G$ with itself, that is, $G^{(1)}(x) = G(x)$ and $G^{(k+1)}(x) = G(G^{(k)}(x))$. Determine all pairs $p, n$ for which there exist $v$ and $M$ such that the $p^n$ vectors $G^{(k)}(0)$, $k=1,2,\dots,p^n$ are distinct.

Answer: {q | let ⟨n, _⟩ := q; n = 1} ∪ {(2,2)}

Lean 4 formalization:
open Matrix Function
Independent variables:
t: ℕ
name: n
Hypotheses:
t: ℕ
name: p
t: n > 0
name: hn
t: Nat.Prime p
name: hp
t: Type*
name: F
t: Field F
t: Fintype F
t: Fintype.card F = p
name: hK
t: Matrix (Fin n) (Fin n) F → (Fin n → F) → (Fin n → F) → (Fin n → F)
name: G
t: ∀ M v x, G M v x = v + mulVec M x
name: hG
Conclusion:
((n, p) ∈ answer ↔
    ∃ᵉ (M : Matrix (Fin n) (Fin n) F) (v : (Fin n → F)),
      ¬(∃ i j : Finset.range (p^n), i ≠ j ∧ (G M v)^[i + 1] 0 = (G M v)^[j + 1] 0))
Formal answer (type: Set (ℕ × ℕ)):
answer =
  (({((n, snd) : ℕ × ℕ) : ℕ × ℕ | n = (1 : ℕ)} : Set (ℕ × ℕ)) ∪ ({(((2 : ℕ), (2 : ℕ)) : ℕ × ℕ)} : Set (ℕ × ℕ)) :
    Set (ℕ × ℕ))
Problem: Let $f(x,y)$ be a continuous, real-valued function on $\mathbb{R}^2$. Suppose that, for every rectangular region $R$ of area $1$, the double integral of $f(x,y)$ over $R$ equals $0$.
Must $f(x,y)$ be identically $0$?

Answer: True

Lean 4 formalization:
open Matrix Function
Independent variables:
Hypotheses:
t: ((ℝ × ℝ) → ℝ) → Prop
name: p
t: ∀ f, p f ↔
      Continuous f ∧
      ∀ x1 x2 y1 y2 : ℝ, x2 > x1 → y2 > y1
        → (x2 - x1) * (y2 - y1) = 1 → ∫ x in x1..x2, ∫ y in y1..y2, f (x, y) = 0
name: hp
Conclusion:
((∀ f x y, p f → f (x, y) = 0) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: A round-robin tournament of $2n$ teams lasted for $2n-1$ days, as follows. On each day, every team played one game against another team, with one team winning and one team losing in each of the $n$ games. Over the course of the tournament, each team played every other team exactly once. Can one necessarily choose one winning team from each day without choosing any team more than once?

Answer: True

Lean 4 formalization:
open Matrix Function Real
Independent variables:
Hypotheses:
t: (n : ℕ) → (Fin (2 * n - 1) → (Fin (2 * n) → Fin (2 * n))) → Prop
name: nmatchupsgames
t: (n : ℕ) → (Fin (2 * n - 1) → (Fin (2 * n) → Fin (2 * n))) → Prop
name: nmatchupsall
t: (n : ℕ) → (Fin (2 * n - 1) → (Fin (2 * n) → Fin (2 * n))) → (Fin (2 * n - 1) → (Fin (2 * n) → Bool)) → Prop
name: nmatchupswins
t: (n : ℕ) → (Fin (2 * n - 1) → (Fin (2 * n) → Fin (2 * n))) → (Fin (2 * n - 1) → (Fin (2 * n) → Bool)) → Prop
name: nmatchupswinschoices
t: ∀ n matchups, nmatchupsall n matchups ↔ ∀ t1 t2, t1 ≠ t2 → (∃ d, matchups d t1 = t2)
name: hnmatchupsall
t: ∀ n matchups, nmatchupsgames n matchups ↔ ∀ d, ∀ t, matchups d t ≠ t ∧ matchups d (matchups d t) = t
name: hnmatchupsgames
t: ∀ n matchups wins, nmatchupswins n matchups wins ↔ ∀ d t, wins d t = !(wins d (matchups d t))
name: hnmatchupswins
t: ∀ n matchups wins, nmatchupswinschoices n matchups wins ↔ ∃ choices, (∀ d, wins d (choices d)) ∧ Function.Injective choices
name: hnmatchupswinschoices
Conclusion:
((∀ n ≥ 1, ∀ matchups wins,
    (nmatchupsgames n matchups ∧ nmatchupsall n matchups ∧ nmatchupswins n matchups wins) →
    nmatchupswinschoices n matchups wins) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Suppose that $a_0 = 1$ and that $a_{n+1} = a_n + e^{-a_n}$ for $n=0,1,2,\dots$. Does $a_n - \log n$
have a finite limit as $n \to \infty$? (Here $\log n = \log_e n = \ln n$.)

Answer: True

Lean 4 formalization:
open Matrix Function Real Topology Filter
Independent variables:
Hypotheses:
t: ℕ → ℝ
name: a
t: a 0 = 1
name: ha0
t: ∀ n : ℕ, a (n + 1) = a n + exp (-a n)
name: han
Conclusion:
((∃ L : ℝ, Tendsto (fun n ↦ a n - Real.log n) atTop (𝓝 L)) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: For positive integers $n$, let the numbers $c(n)$ be determined by the rules $c(1)=1$, $c(2n)=c(n)$, and $c(2n+1)=(-1)^nc(n)$. Find the value of $\sum_{n=1}^{2013} c(n)c(n+2)$.

Answer: -1

Lean 4 formalization:
open Function Set
Independent variables:
Hypotheses:
t: ℕ → ℤ
name: c
t: c 1 = 1
name: hc1
t: ∀ n : ℕ, n > 0 → c (2 * n) = c n
name: hceven
t: ∀ n : ℕ, n > 0 → c (2 * n + 1) = (-1) ^ n * c n
name: hcodd
Conclusion:
((∑ n : Set.Icc 1 2013, c n * c (n.1 + 2)) = answer)
Formal answer (type: ℤ):
answer = (-1 : ℤ)
Problem: Let $C = \bigcup_{N=1}^\infty C_N$, where $C_N$ denotes the set of those `cosine polynomials' of the form
\[
f(x) = 1 + \sum_{n=1}^N a_n \cos(2 \pi n x)
\]
for which:
\begin{enumerate}
\item[(i)]
$f(x) \geq 0$ for all real $x$, and
\item[(ii)]
$a_n = 0$ whenever $n$ is a multiple of $3$.
\end{enumerate}
Determine the maximum value of $f(0)$ as $f$ ranges through $C$, and
prove that this maximum is attained.

Answer: 3

Lean 4 formalization:
open Function Set
Independent variables:
Hypotheses:
t: ℕ → Set (ℝ → ℝ)
name: CN
t: ∀ N : ℕ, CN N =
    {f : ℝ → ℝ |
      (∀ x : ℝ, f x ≥ 0) ∧
      ∃ a : List ℝ, a.length = N + 1 ∧ (∀ n : Fin (N + 1), 3 ∣ (n : ℕ) → a[n]! = 0) ∧
      ∀ x : ℝ, f x = 1 + ∑ n in Finset.Icc 1 N, a[(n : ℕ)]! * Real.cos (2*Real.pi*n*x)}
name: hCN
Conclusion:
(IsGreatest {f 0 | f ∈ ⋃ N ∈ Ici 1, CN N} answer)
Formal answer (type: ℝ):
answer = (3 : ℝ)
Problem: Let $A$ be the $n \times n$ matrix whose entry in the $i$-th row and $j$-th column is $\frac{1}{\min(i,j)}$ for $1 \leq i,j \leq n$. Compute $\det(A)$.

Answer: (fun n : ℕ => (-1) ^ (n - 1) / ((n - 1)! * (n)!))

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
t: ℕ
name: n
Hypotheses:
t: Matrix (Fin n) (Fin n) ℝ
name: A
t: n > 0
name: npos
t: ∀ i j : Fin n, A i j = 1 / min (i.1 + 1 : ℚ) (j.1 + 1)
name: hA
Conclusion:
(A.det = answer n)
Formal answer (type: ℕ → ℝ):
answer = fun (n : ℕ) =>
  (((-1 : ℝ) ^ (n - (1 : ℕ) : ℕ) : ℝ) / ((↑((n - (1 : ℕ) : ℕ)! : ℕ) : ℝ) * (↑(n ! : ℕ) : ℝ) : ℝ) : ℝ)
Problem: Let \( a_0 = \frac{5}{2} \) and \( a_k = a_{k-1}^2 - 2 \) for \( k \geq 1 \). Compute \( \prod_{k=0}^{\infty} \left(1 - \frac{1}{a_k}\right) \) in closed form.

Answer: \( \frac{3}{7} \)

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
Hypotheses:
t: ℕ → ℝ
name: a
t: a 0 = 5 / 2
name: a0
t: ∀ k ≥ 1, a k = (a (k - 1)) ^ 2 - 2
name: ak
Conclusion:
(Tendsto (fun n : ℕ => ∏ k in Finset.range n, (1 - 1 / a k)) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (3 / 7 : ℝ)
Problem: Suppose $X$ is a random variable that takes on only nonnegative integer values, with $E\left[X\right]=1$, $E\left[X^2\right]=2$, and $E\left[X^3\right]=5$. (Here $E\left[Y\right]$ denotes the expectation of the random variable $Y$.) Determine the smallest possible value of the probability of the event $X=0$.

Answer: 1/3

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
Hypotheses:
t: (ℕ → ℝ) → Prop
name: Xrandvar
t: Xrandvar = (fun X : ℕ → ℝ => (∀ n : ℕ, X n ∈ Set.Icc 0 1) ∧ ∑' n : ℕ, X n = 1)
name: hXrandvar
t: (ℕ → ℝ) → (ℕ → ℝ) → ℝ
name: E
t: E = (fun (X : ℕ → ℝ) (f : ℕ → ℝ) => ∑' n : ℕ, f n * X n)
name: hE
Conclusion:
(sInf {X0 : ℝ | ∃ X : ℕ → ℝ, Xrandvar X ∧ E X (fun x : ℕ => x) = 1 ∧ E X (fun x : ℕ => x ^ 2) = 2 ∧ E X (fun x : ℕ => x ^ 3) = 5 ∧ X0 = X 0} = answer)
Formal answer (type: ℝ):
answer = (1 / 3 : ℝ)
Problem: Let \( n \) be a positive integer. What is the largest \( k \) for which there exist \( n \times n \) matrices \( M_1, \ldots, M_k \) and \( N_1, \ldots, N_k \) with real entries such that for all \( i \) and \( j \), the matrix product \( M_i N_j \) has a zero entry somewhere on its diagonal if and only if \( i \neq j \)?

Answer: n^n

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
t: ℕ
name: n
Hypotheses:
t: ℕ → Prop
name: kex
t: n > 0
name: npos
t: ∀ k ≥ 1, kex k = ∃ M N : Fin k → Matrix (Fin n) (Fin n) ℝ, ∀ i j : Fin k, ((∃ p : Fin n, (M i * N j) p p = 0) ↔ i ≠ j)
name: hkex
Conclusion:
((answer n ≥ 1 ∧ kex (answer n)) ∧ (∀ k ≥ 1, kex k → k ≤ answer n))
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => (n ^ n : ℕ)
Problem: A \emph{base $10$ over-expansion} of a positive integer $N$ is an expression of the form
\[
N = d_k 10^k + d_{k-1} 10^{k-1} + \cdots + d_0 10^0
\]
with $d_k \neq 0$ and $d_i \in \{0,1,2,\dots,10\}$ for all $i$. For instance, the integer $N = 10$ has two base $10$ over-expansions: $10 = 10 \cdot 10^0$ and the usual base $10$ expansion $10 = 1 \cdot 10^1 + 0 \cdot 10^0$. Which positive integers have a unique base $10$ over-expansion?

Answer: the set of positive integers that do not contain the digit 0 in their base 10 representation

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
Hypotheses:
t: ℕ → List ℕ → Prop
name: overexpansion
t: overexpansion = fun N d ↦ N = ∑ i : Fin d.length, (d.get i) * 10 ^ i.1 ∧ d.getLastI ≠ 0 ∧ ∀ a ∈ d, a ∈ Finset.range 11
name: hoverexpansion
t: Set ℕ
name: S
t: ∀ N : ℕ, N ∈ S ↔ N > 0 ∧ ∃! d : List ℕ, overexpansion N d
name: hS
Conclusion:
(S = answer)
Formal answer (type: Set ℕ):
answer = ({n : ℕ | n > (0 : ℕ) ∧ ¬∃ a ∈ (Nat.digits (10 : ℕ) n : List ℕ), a = (0 : ℕ)} : Set ℕ)
Problem: Suppose that \( f \) is a function on the interval \([1,3]\) such that \(-1 \leq f(x) \leq 1\) for all \( x \) and \( \int_{1}^{3} f(x) \, dx = 0 \). How large can \(\int_{1}^{3} \frac{f(x)}{x} \, dx \) be?

Answer: \( \log(4/3) \)

Lean 4 formalization:
open Topology Filter Nat
Independent variables:
Hypotheses:
Conclusion:
(IsGreatest {t | ∃ f : ℝ → ℝ,
    (∀ x : Set.Icc (1 : ℝ) 3, -1 ≤ f x ∧ f x ≤ 1) ∧
    (∫ x in Set.Ioo 1 3, f x = 0) ∧
    (∫ x in Set.Ioo 1 3, (f x) / x) = t}
  answer)
Formal answer (type: ℝ):
answer = (Real.log (4 / 3 : ℝ) : ℝ)
Problem: Let $a_0=1$, $a_1=2$, and $a_n=4a_{n-1}-a_{n-2}$ for $n \geq 2$. Find an odd prime factor of $a_{2015}$.

Answer: 181

Lean 4 formalization:
Independent variables:
Hypotheses:
t: ℕ → ℤ
name: a
t: a 0 = 1 ∧ a 1 = 2
name: abase
t: ∀ n ≥ 2, a n = 4 * a (n - 1) - a (n - 2)
name: arec
Conclusion:
(Odd answer ∧ answer.Prime ∧ ((answer : ℤ) ∣ a 2015))
Formal answer (type: ℕ):
answer = (181 : ℕ)
Problem: Compute $\log_2 \left( \prod_{a=1}^{2015}\prod_{b=1}^{2015}(1+e^{2\pi iab/2015}) \right)$. Here $i$ is the imaginary unit (that is, $i^2=-1$).

Answer: 13725

Lean 4 formalization:
Independent variables:
Hypotheses:
Conclusion:
(Complex.log (∏ a : Fin 2015, ∏ b : Fin 2015, (1 + Complex.exp (2 * Real.pi * Complex.I * (a.1 + 1) * (b.1 + 1) / 2015))) / Complex.log 2 = answer)
Formal answer (type: ℂ):
answer = (13725 : ℂ)
Problem: For each real number $x$, let
\[
f(x) = \sum_{n\in S_x} \frac{1}{2^n},
\]
where $S_x$ is the set of positive integers $n$ for which $\lfloor nx \rfloor$ is even. What is the largest real number $L$ such that $f(x) \geq L$ for all $x \in [0,1)$? (As usual, $\lfloor z \rfloor$ denotes the greatest integer less than or equal to $z$.)

Answer: 4/7

Lean 4 formalization:
Independent variables:
Hypotheses:
t: ℝ → Set ℤ
name: S
t: ℝ → ℝ
name: f
t: S = fun (x : ℝ) ↦ {n : ℤ | n > 0 ∧ Even ⌊n * x⌋}
name: hS
t: f = fun (x : ℝ) ↦ ∑' n : S x, 1 / 2 ^ (n : ℤ)
name: hf
Conclusion:
(IsGreatest {l : ℝ | ∀ x ∈ Set.Ico 0 1, f x ≥ l} answer)
Formal answer (type: ℝ):
answer = (4 / 7 : ℝ)