purewhite42/formal_problem_solving_main huggingface dataset:
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
Conclusions: ((∀ x : ℝ, p.eval x * q.eval (x + 1) - p.eval (x + 1) * q.eval x = 1) ↔ (p, q) ∈ answer)
Answer type: Set (Polynomial ℝ × Polynomial ℝ)
Formal answer: 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
Conclusions: ((∃ f : ℝ → ℝ, StrictMono f ∧ Differentiable ℝ f ∧ (∀ x : ℝ, deriv f x = f (f x))) ↔ answer)
Answer type: Prop
Formal answer: 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:
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
Conclusions: ({p | 0 ≤ p 0 ∧ p 0 ≤ 2011 ∧ 0 ≤ p 1 ∧ p 1 ≤ 2011 ∧ ¬∃ spiral, IsSpiral spiral ∧ spiral.getLast! = p}.encard = answer)
Answer type: ℕ
Formal answer: 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
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
Conclusions: (Tendsto (fun n => ∑ i : Fin n, 1/(∏ j : Fin (i + 1), (a j))) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: 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
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
Conclusions: (answer = (c, L))
Answer type: ℝ × ℝ
Formal answer: 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
Conclusions: (nmat n ↔ n ∈ answer)
Answer type: Set ℕ
Formal answer: 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
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
Conclusions: ((t.Prime ∧ ({s ∈ S | ∃ i : Fin 3, s i = t}.encard ≥ 7)) ↔ t ∈ answer)
Answer type: Set ℕ
Formal answer: 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
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
Conclusions: (DifferentiableAt ℝ f 0 ↔ answer)
Answer type: Prop
Formal answer: 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
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
Conclusions: (fsat answer ∧ ∀ f : ℝ → ℝ, fsat f → ∀ x ∈ S, f x = answer x)
Answer type: ℝ → ℝ
Formal answer: 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
Conclusions: ((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))
Answer type: Set (ℕ × ℕ)
Formal answer: 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
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
Conclusions: ((∀ f x y, p f → f (x, y) = 0) ↔ answer)
Answer type: Prop
Formal answer: 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
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
Conclusions: ((∀ n ≥ 1, ∀ matchups wins,
    (nmatchupsgames n matchups ∧ nmatchupsall n matchups ∧ nmatchupswins n matchups wins) →
    nmatchupswinschoices n matchups wins) ↔ answer)
Answer type: Prop
Formal answer: 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
Hypotheses: t: ℕ → ℝ
name: a
t: a 0 = 1
name: ha0
t: ∀ n : ℕ, a (n + 1) = a n + exp (-a n)
name: han
Conclusions: ((∃ L : ℝ, Tendsto (fun n ↦ a n - Real.log n) atTop (𝓝 L)) ↔ answer)
Answer type: Prop
Formal answer: 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
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
Conclusions: ((∑ n : Set.Icc 1 2013, c n * c (n.1 + 2)) = answer)
Answer type: ℤ
Formal answer: 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
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
Conclusions: (IsGreatest {f 0 | f ∈ ⋃ N ∈ Ici 1, CN N} answer)
Answer type: ℝ
Formal answer: 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
Conclusions: (A.det = answer n)
Answer type: ℕ → ℝ
Formal answer: 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
Hypotheses: t: ℕ → ℝ
name: a
t: a 0 = 5 / 2
name: a0
t: ∀ k ≥ 1, a k = (a (k - 1)) ^ 2 - 2
name: ak
Conclusions: (Tendsto (fun n : ℕ => ∏ k in Finset.range n, (1 - 1 / a k)) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: 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
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
Conclusions: (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)
Answer type: ℝ
Formal answer: 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
Conclusions: ((answer n ≥ 1 ∧ kex (answer n)) ∧ (∀ k ≥ 1, kex k → k ≤ answer n))
Answer type: ℕ → ℕ
Formal answer: 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
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
Conclusions: (S = answer)
Answer type: Set ℕ
Formal answer: 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
Conclusions: (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)
Answer type: ℝ
Formal answer: 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:
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
Conclusions: (Odd answer ∧ answer.Prime ∧ ((answer : ℤ) ∣ a 2015))
Answer type: ℕ
Formal answer: 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:
Conclusions: (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)
Answer type: ℂ
Formal answer: 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:
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
Conclusions: (IsGreatest {l : ℝ | ∀ x ∈ Set.Ico 0 1, f x ≥ l} answer)
Answer type: ℝ
Formal answer: answer = (4 / 7 : ℝ)
Problem: Given a list of the positive integers $1,2,3,4,\dots$, take the first three numbers $1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three smallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6,16,27,36,\dots$. Prove or disprove that there is some number in the sequence whose base $10$ representation ends with $2015$.

Answer: True

Lean 4 formalization:
Hypotheses: t: ℕ → Set ℕ
name: sets
t: Set ℕ → (Fin 3 → ℕ)
name: Smin3
t: ℕ → ℕ
name: sums
t: sets 0 = Set.Ici 1
name: hsets0
t: ∀ S : Set ℕ, S.encard ≥ 3 → ((Smin3 S) 0 = sInf S ∧ (Smin3 S) 1 = sInf (S \ {(Smin3 S) 0}) ∧ (Smin3 S) 2 = sInf (S \ {(Smin3 S) 0, (Smin3 S) 1}))
name: hmin3
t: ∀ n : ℕ, sums n = (Smin3 (sets n)) 0 + (Smin3 (sets n)) 1 + (Smin3 (sets n)) 2
name: hsums
t: ∀ n : ℕ, sets (n + 1) = sets n \ {(Smin3 (sets n)) 0, (Smin3 (sets n)) 1, (Smin3 (sets n)) 2, sums n}
name: hsetsn
Conclusions: ((∃ n : ℕ, List.IsPrefix [5, 1, 0, 2] (Nat.digits 10 (sums n))) ↔ answer)
Answer type: Prop
Formal answer: answer = True
Problem: Let $S$ be the set of all $2 \times 2$ real matrices $M=\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ whose entries $a,b,c,d$ (in that order) form an arithmetic progression. Find all matrices $M$ in $S$ for which there is some integer $k>1$ such that $M^k$ is also in $S$.

Answer: the set of all matrices of the form α * I or β * A, where I is the identity matrix and A is a specific matrix

Lean 4 formalization:
Hypotheses: t: Matrix (Fin 2) (Fin 2) ℝ
name: M
t: Set (Matrix (Fin 2) (Fin 2) ℝ)
name: S
t: S = {M' | (M' 0 1 - M' 0 0 = M' 1 0 - M' 0 1) ∧ (M' 1 0 - M' 0 1 = M' 1 1 - M' 1 0)}
name: hS
Conclusions: (M ∈ S ∧ (∃ k > 1, M ^ k ∈ S) ↔ M ∈ answer)
Answer type: Set (Matrix (Fin 2) (Fin 2) ℝ)
Formal answer: answer =
  ({A : Matrix (Fin (2 : ℕ)) (Fin (2 : ℕ)) ℝ |
      (∃ (α : ℝ), ∀ (i j : Fin (2 : ℕ)), (A i j : ℝ) = (α * (1 : ℝ) : ℝ)) ∨
        ∃ (β : ℝ),
          (A (0 : Fin (2 : ℕ)) (0 : Fin (2 : ℕ)) : ℝ) = (β * (-3 : ℝ) : ℝ) ∧
            (A (0 : Fin (2 : ℕ)) (1 : Fin (2 : ℕ)) : ℝ) = (β * (-1 : ℝ) : ℝ) ∧
              (A (1 : Fin (2 : ℕ)) (0 : Fin (2 : ℕ)) : ℝ) = (β * (1 : ℝ) : ℝ) ∧
                (A (1 : Fin (2 : ℕ)) (1 : Fin (2 : ℕ)) : ℝ) = (β * (3 : ℝ) : ℝ)} :
    Set (Matrix (Fin (2 : ℕ)) (Fin (2 : ℕ)) ℝ))
Problem: Let $T$ be the set of all triples $(a,b,c)$ of positive integers for which there exist triangles with side lengths $a,b,c$. Express
\[
\sum_{(a,b,c) \in T} \frac{2^a}{3^b 5^c}
\]
as a rational number in lowest terms.

Answer: (17, 21)

Lean 4 formalization:
Hypotheses: t: ℚ → (ℤ × ℕ)
name: quotientof
t: ∀ q : ℚ, quotientof q = (q.num, q.den)
name: hquotientof
Conclusions: (quotientof (∑' t : (Fin 3 → ℤ), if (∀ n : Fin 3, t n > 0) ∧ t 0 < t 1 + t 2 ∧ t 1 < t 2 + t 0 ∧ t 2 < t 0 + t 1
    then 2^(t 0)/(3^(t 1)*5^(t 2)) else 0) = answer)
Answer type: ℤ × ℕ
Formal answer: answer = (((17 : ℤ), (21 : ℕ)) : ℤ × ℕ)
Problem: Let $P_n$ be the number of permutations $\pi$ of $\{1,2,\dots,n\}$ such that
\[
|i-j| = 1 \mbox{ implies } |\pi(i) -\pi(j)| \leq 2
\]
for all $i,j$ in $\{1,2,\dots,n\}$. Show that for $n \geq 2$, the quantity
\[
P_{n+5} - P_{n+4} - P_{n+3} + P_n
\]
does not depend on $n$, and find its value.

Answer: 4

Lean 4 formalization:
open Function
Hypotheses: t: ℕ → ℕ
name: P
t: P = fun n ↦ {pi : Finset.Icc 1 n → Finset.Icc 1 n | Bijective pi ∧ ∀ i j : Finset.Icc 1 n, Nat.dist i j = 1 → Nat.dist (pi i) (pi j) ≤ 2}.ncard
name: hP
Conclusions: (∀ n : ℕ, n ≥ 2 → (P (n + 5) : ℤ) - (P (n + 4) : ℤ) - (P (n + 3) : ℤ) + (P n : ℤ) = answer)
Answer type: ℕ
Formal answer: answer = (4 : ℕ)
Problem: For each positive integer $k$, let $A(k)$ be the number of odd divisors of $k$ in the interval $[1,\sqrt{2k})$. Evaluate $\sum_{k=1}^\infty (-1)^{k-1}\frac{A(k)}{k}$.

Answer: π² / 16

Lean 4 formalization:
open Filter Topology
Hypotheses: t: ℕ → ℕ
name: A
t: ∀ k > 0, A k = {j : ℕ | Odd j ∧ j ∣ k ∧ j < Real.sqrt (2 * k)}.encard
name: hA
Conclusions: (Tendsto (fun K : ℕ ↦ ∑ k in Finset.Icc 1 K, (-1 : ℝ) ^ ((k : ℝ) - 1) * (A k / (k : ℝ))) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (((Real.pi : ℝ) ^ (2 : ℕ) : ℝ) / (16 : ℝ) : ℝ)
Problem: Find the smallest positive integer $j$ such that for every polynomial $p(x)$ with integer coefficients and for every integer $k$, the integer \[ p^{(j)}(k) = \left. \frac{d^j}{dx^j} p(x) \right|_{x=k} \] (the $j$-th derivative of $p(x)$ at $k$) is divisible by 2016.

Answer: 8

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat
Conclusions: (IsLeast {j : ℕ | 0 < j ∧ ∀ P : ℤ[X], ∀ k : ℤ, 2016 ∣ (derivative^[j] P).eval k} answer)
Answer type: ℕ
Formal answer: answer = (8 : ℕ)
Problem: Given a positive integer $n$, let $M(n)$ be the largest integer $m$ such that
\[
\binom{m}{n-1} > \binom{m-1}{n}.
\]
Evaluate
\[
\lim_{n \to \infty} \frac{M(n)}{n}.
\]

Answer: (3 + √5) / 2

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat
Hypotheses: t: ℕ → ℕ
name: M
t: ∀ n > 0, IsGreatest {m | 0 < m ∧ (m - 1).choose n < m.choose (n - 1)} (M n)
name: hM
Conclusions: (Tendsto (fun n ↦ M n / (n : ℝ)) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (((3 : ℝ) + (√(5 : ℝ) : ℝ) : ℝ) / (2 : ℝ) : ℝ)
Problem: Suppose that $f$ is a function from $\mathbb{R}$ to $\mathbb{R}$ such that
\[
f(x) + f\left( 1 - \frac{1}{x} \right) = \arctan x
\]
for all real $x \neq 0$. (As usual, $y = \arctan x$ means $-\pi/2 < y < \pi/2$ and $\tan y = x$.) Find
\[
\int_0^1 f(x)\,dx.
\]

Answer: 3π/8

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat
Hypotheses: t: ℝ → ℝ
name: f
t: ∀ x : ℝ, x ≠ 0 → f x + f (1 - 1 / x) = Real.arctan x
name: hf
Conclusions: (∫ x in (0)..1, f x = answer)
Answer type: ℝ
Formal answer: answer = (((3 : ℝ) * (π : ℝ) : ℝ) / (8 : ℝ) : ℝ)
Problem: Find the smallest constant $C$ such that for every real polynomial $P(x)$ of degree $3$ that has a root in the interval $[0,1]$,
\[
\int_0^1 \left| P(x) \right|\,dx \leq C \max_{x \in [0,1]} \left| P(x) \right|.
\]

Answer: 5 / 6

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat List
Hypotheses: t: ℝ → Prop
name: p
t: ∀ c, p c ↔
        ∀ P : Polynomial ℝ, P.degree = 3 →
        (∃ x ∈ Icc 0 1, P.eval x = 0) →
        ∫ x in (0)..1, |P.eval x| ≤ c * (sSup {y | ∃ x ∈ Icc 0 1, y = |P.eval x|})
name: hp
Conclusions: (IsLeast p answer)
Answer type: ℝ
Formal answer: answer = (5 / 6 : ℝ)