purewhite42/formal_problem_solving_main huggingface dataset:
Problem: Let $x_0,x_1,x_2,\dots$ be the sequence such that $x_0=1$ and for $n \geq 0$,
\[
x_{n+1} = \ln(e^{x_n} - x_n)
\]
(as usual, the function $\ln$ is the natural logarithm). Show that the infinite series
\[
x_0 + x_1 + x_2 + \cdots
\]
converges and find its sum.

Answer: exp 1 - 1

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat List
Hypotheses: t: ℕ → ℝ
name: x
t: x 0 = 1
name: hx0
t: ∀ n : ℕ, x (n + 1) = log (exp (x n) - (x n))
name: hxn
Conclusions: (∑' n : ℕ, x n = answer)
Answer type: ℝ
Formal answer: answer = ((rexp (1 : ℝ) : ℝ) - (1 : ℝ) : ℝ)
Problem: Define a positive integer $n$ to be \emph{squarish} if either $n$ is itself a perfect square or the distance from $n$ to the nearest perfect square is a perfect square. For example, $2016$ is squarish, because the nearest perfect square to $2016$ is $45^2 = 2025$ and $2025 - 2016 = 9$ is a perfect square. (Of the positive integers between $1$ and $10$, only $6$ and $7$ are not squarish.)

For a positive integer $N$, let $S(N)$ be the number of squarish integers between $1$ and $N$,
inclusive. Find positive constants $\alpha$ and $\beta$ such that
\[
\lim_{N \to \infty} \frac{S(N)}{N^\alpha} = \beta,
\]
or show that no such constants exist.

Answer: (3/4, 4/3)

Lean 4 formalization:
open Classical Polynomial Filter Topology Real Set Nat List
Hypotheses: t: ℤ → Prop
name: squarish
t: ∀ n, squarish n ↔ IsSquare n ∨ ∃ w : ℤ, IsSquare |n - w ^ 2| ∧ ∀ v : ℕ, |n - w ^ 2| ≤ |n - v ^ 2|
name: hsquarish
t: ℤ → ℕ
name: S
t: S = fun n ↦ {i ∈ Finset.Icc 1 n | squarish i}.card
name: hS
t: ℝ → ℝ → Prop
name: p
t: ∀ α β, p α β ↔ α > 0 ∧ β > 0 ∧ Tendsto (fun N ↦ S N / (N : ℝ) ^ α) atTop (𝓝 β)
name: hp
Conclusions: ((∀ α β : ℝ, ((α, β) = answer ↔ p α β)) ∨ ¬∃ α β : ℝ, p α β)
Answer type: ℝ × ℝ
Formal answer: answer = (((3 / 4 : ℝ), (4 / 3 : ℝ)) : ℝ × ℝ)
Problem: Let $A$ be a $2n \times 2n$ matrix, with entries chosen independently at random. Every entry is chosen to be $0$ or $1$, each with probability $1/2$. Find the expected value of $\det(A-A^t)$ (as a function of $n$), where $A^t$ is the transpose of $A$.

Answer: (fun n : ℕ => (2 * n)! / (4 ^ n * (n)!))

Lean 4 formalization:
open Real Set Nat
Independent variables: t: ℕ
name: n
Hypotheses: t: n ≥ 1
name: npos
t: Set (Matrix (Fin (2 * n)) (Fin (2 * n)) ℝ)
name: mats01
t: mats01 = {A | ∀ i j : Fin (2 * n), A i j = 0 ∨ A i j = 1}
name: hmats01
Conclusions: ((∑' A : mats01, (A.1 - (Matrix.transpose A)).det) / mats01.ncard = answer n)
Answer type: ℕ → ℝ
Formal answer: answer = fun (n : ℕ) => ((↑(((2 : ℕ) * n : ℕ)! : ℕ) : ℝ) / (((4 : ℝ) ^ n : ℝ) * (↑(n ! : ℕ) : ℝ) : ℝ) : ℝ)
Problem: Find all functions $f$ from the interval $(1,\infty)$ to $(1,\infty)$ with the following property: if $x,y \in (1,\infty)$ and $x^2 \leq y \leq x^3$, then $(f(x))^2 \leq f(y) \leq (f(x))^3$.

Answer: the set of all functions of the form f(x) = x^c for some c > 0

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat List
Independent variables: t: Set.Ioi (1 : ℝ) → Set.Ioi (1 : ℝ)
name: f
Conclusions: (f ∈ answer ↔
    (∀ x y : Set.Ioi (1 : ℝ), ((x : ℝ) ^ 2 ≤ y ∧ y ≤ (x : ℝ) ^ 3) → ((f x : ℝ) ^ 2 ≤ f y ∧ f y ≤ (f x : ℝ) ^ 3)))
Answer type: Set (Set.Ioi (1 : ℝ) → Set.Ioi (1 : ℝ))
Formal answer: answer =
  ({f : ↑(Set.Ioi (1 : ℝ) : Set ℝ) → ↑(Set.Ioi (1 : ℝ) : Set ℝ) |
      ∃ c > (0 : ℝ),
        ∀ (x : ↑(Set.Ioi (1 : ℝ) : Set ℝ)), (↑(f x : ↑(Set.Ioi (1 : ℝ) : Set ℝ)) : ℝ) = ((↑x : ℝ) ^ c : ℝ)} :
    Set (↑(Set.Ioi (1 : ℝ) : Set ℝ) → ↑(Set.Ioi (1 : ℝ) : Set ℝ)))
Problem: Evaluate $\sum_{k=1}^\infty \frac{(-1)^{k-1}}{k} \sum_{n=0}^\infty \frac{1}{k2^n+1}$.

Answer: 1

Lean 4 formalization:
open Polynomial Filter Topology Real Set Nat List
Conclusions: (∑' k : ℕ, ((-1 : ℝ) ^ ((k + 1 : ℤ) - 1) / (k + 1 : ℝ)) * ∑' n : ℕ, (1 : ℝ) / ((k + 1) * (2 ^ n) + 1) = answer)
Answer type: ℝ
Formal answer: answer = (1 : ℝ)
Problem: Let $S$ be the smallest set of positive integers such that (a) $2$ is in $S$, (b) $n$ is in $S$ whenever $n^2$ is in $S$, and (c) $(n+5)^2$ is in $S$ whenever $n$ is in $S$. Which positive integers are not in $S$?.

Answer: {x : ℤ | x > 0 ∧ (x = 1 ∨ 5 ∣ x)}

Lean 4 formalization:
Hypotheses: t: Set ℤ → Prop
name: IsQualifying
t: ∀ S, IsQualifying S ↔
  (∀ n ∈ S, 0 < n) ∧
  2 ∈ S ∧
  (∀ n > 0, n ^ 2 ∈ S → n ∈ S) ∧
  (∀ n ∈ S, (n + 5) ^ 2 ∈ S)
name: IsQualifying_def
t: Set ℤ
name: S
t: IsLeast IsQualifying S
name: hS
Conclusions: (Sᶜ ∩ {n | 0 < n} = answer)
Answer type: Set ℤ
Formal answer: answer = ({x : ℤ | x > (0 : ℤ) ∧ (x = (1 : ℤ) ∨ (5 : ℤ) ∣ x)} : Set ℤ)
Problem: Suppose that a positive integer $N$ can be expressed as the sum of $k$ consecutive positive integers
\[
N = a + (a+1) +(a+2) + \cdots + (a+k-1)
\]
for $k=2017$ but for no other values of $k>1$. Considering all positive integers $N$ with this property, what is the smallest positive integer $a$ that occurs in any of these expressions?

Answer: 16

Lean 4 formalization:
open Topology Filter
Hypotheses: t: ℤ → ℕ → ℤ
name: S
t: ℤ → ℕ → Prop
name: p
t: ℤ → Prop
name: q
t: S = fun (a : ℤ) k ↦ ∑ i in Finset.range k, (a + i)
name: hS
t: ∀ N k, p N k ↔ ∃ a > 0, S a k = N
name: hp
t: ∀ N, q N ↔ p N 2017 ∧ ∀ k : ℕ, k > 1 → k ≠ 2017 → ¬p N k
name: hq
Conclusions: (IsLeast {a : ℤ | q (S a 2017)} answer)
Answer type: ℕ
Formal answer: answer = (16 : ℕ)
Problem: Evaluate the sum \begin{gather*} \sum_{k=0}^\infty \left( 3 \cdot \frac{\ln(4k+2)}{4k+2} - \frac{\ln(4k+3)}{4k+3} - \frac{\ln(4k+4)}{4k+4} - \frac{\ln(4k+5)}{4k+5} \right) \ = 3 \cdot \frac{\ln 2}{2} - \frac{\ln 3}{3} - \frac{\ln 4}{4} - \frac{\ln 5}{5} + 3 \cdot \frac{\ln 6}{6} - \frac{\ln 7}{7} \ - \frac{\ln 8}{8} - \frac{\ln 9}{9} + 3 \cdot \frac{\ln 10}{10} - \cdots . \end{gather*} (As usual, $\ln x$ denotes the natural logarithm of $x$.)

Answer: (log 2) ^ 2

Lean 4 formalization:
open Topology Filter Real
Conclusions: ((∑' k : ℕ, (3 * Real.log (4 * k + 2) / (4 * k + 2) - Real.log (4 * k + 3) / (4 * k + 3) - Real.log (4 * k + 4) / (4 * k + 4) - Real.log (4 * k + 5) / (4 * k + 5)) = answer))
Answer type: ℝ
Formal answer: answer = ((Real.log (2 : ℝ) : ℝ) ^ (2 : ℕ) : ℝ)
Problem: Find the number of ordered $64$-tuples $(x_0,x_1,\dots,x_{63})$ such that $x_0,x_1,\dots,x_{63}$ are distinct elements of $\{1,2,\dots,2017\}$ and
\[
x_0 + x_1 + 2x_2 + 3x_3 + \cdots + 63 x_{63}
\]
is divisible by 2017.

Answer: 2016! / 1953! - 63! * 2016

Lean 4 formalization:
open Topology Filter Real Function Nat
Hypotheses: t: Finset (Finset.range 64 → Finset.Icc 1 2017)
name: S
t: ∀ x, x ∈ S ↔ (Injective x ∧ (2017 ∣ (∑ i : Finset.range 64, if i ≤ (⟨1, by norm_num⟩ : Finset.range 64) then (x i : ℤ) else i * (x i : ℤ))))
name: hs
Conclusions: (S.card = answer)
Answer type: ℕ
Formal answer: answer = ((((2016 : ℕ)! : ℕ) / ((1953 : ℕ)! : ℕ) : ℕ) - (((63 : ℕ)! : ℕ) * (2016 : ℕ) : ℕ) : ℕ)
Problem: Find all ordered pairs $(a,b)$ of positive integers for which $\frac{1}{a} + \frac{1}{b} = \frac{3}{2018}$.

Answer: {⟨673, 1358114⟩, ⟨674, 340033⟩, ⟨1009, 2018⟩, ⟨2018, 1009⟩, ⟨340033, 674⟩, ⟨1358114, 673⟩}

Lean 4 formalization:
Hypotheses: t: ℤ
name: a
t: ℤ
name: b
t: 0 < a ∧ 0 < b
name: h
Conclusions: (((1 : ℚ) / a + (1 : ℚ) / b = (3 : ℚ) / 2018) ↔ (⟨a, b⟩ ∈ answer))
Answer type: Set (ℤ × ℤ)
Formal answer: answer =
  (Insert.insert (((673 : ℤ), (1358114 : ℤ)) : ℤ × ℤ)
      (Insert.insert (((674 : ℤ), (340033 : ℤ)) : ℤ × ℤ)
          (Insert.insert (((1009 : ℤ), (2018 : ℤ)) : ℤ × ℤ)
              (Insert.insert (((2018 : ℤ), (1009 : ℤ)) : ℤ × ℤ)
                  (Insert.insert (((340033 : ℤ), (674 : ℤ)) : ℤ × ℤ)
                      ({(((1358114 : ℤ), (673 : ℤ)) : ℤ × ℤ)} : Set (ℤ × ℤ)) :
                    Set (ℤ × ℤ)) :
                Set (ℤ × ℤ)) :
            Set (ℤ × ℤ)) :
        Set (ℤ × ℤ)) :
    Set (ℤ × ℤ))
Problem: Let \( S_1, S_2, \ldots, S_{2^n-1} \) be the nonempty subsets of \( \{1, 2, \ldots, n\} \) in some order, and let \( M \) be the \( (2^n - 1) \times (2^n - 1) \) matrix whose \((i, j)\) entry is $m_{ij} = \begin{cases} 0 & \text{if } S_i \cap S_j = \emptyset; \\ 1 & \text{otherwise}. \end{cases} $ Calculate the determinant of \( M \).

Answer: 1 if n = 1, otherwise -1

Lean 4 formalization:
Independent variables: t: ℕ
name: n
Hypotheses: t: Fin (2 ^ n - 1) → Set ℕ
name: S
t: Matrix (Fin (2 ^ n - 1)) (Fin (2 ^ n - 1)) ℝ
name: M
t: n ≥ 1
name: npos
t: Set.range S = (Set.Icc 1 n).powerset \ {∅}
name: hS
t: ∀ i j, M i j = if (S i ∩ S j = ∅) = True then 0 else 1
name: hM
Conclusions: (M.det = answer n)
Answer type: ℕ → ℝ
Formal answer: answer = fun (n : ℕ) => (if n = (1 : ℕ) then (1 : ℝ) else (-1 : ℝ) : ℝ)
Problem: Determine the greatest possible value of $\sum_{i=1}^{10} \cos(3x_i)$ for real numbers $x_1, x_2, \ldots, x_{10}$ satisfying $\sum_{i=1}^{10} \cos(x_i) = 0$.

Answer: 480/49

Lean 4 formalization:
Conclusions: (IsGreatest
      {∑ i, Real.cos (3 * x i) | (x : Fin 10 → ℝ) (hx : ∑ i, Real.cos (x i) = 0)}
      answer)
Answer type: ℝ
Formal answer: answer = (480 / 49 : ℝ)
Problem: Let $\mathcal{P}$ be the set of vectors defined by $\mathcal{P}=\left\{\left.\begin{pmatrix} a \\ b \end{pmatrix}\right| 0 \leq a \leq 2, 0 \leq b \leq 100,\text{ and }a,b \in \mathbb{Z}\right\}$. Find all $\mathbf{v} \in \mathcal{P}$ such that the set $\mathcal{P} \setminus \{\mathbf{v}\}$ obtained by omitting vector $\mathbf{v}$ from $\mathcal{P}$ can be partitioned into two sets of equal size and equal sum.

Answer: {v : Mathlib.Vector ℤ 2 | ∃ b : ℤ, 0 ≤ b ∧ b ≤ 100 ∧ Even b ∧ v.toList = [1, b]}

Lean 4 formalization:
Independent variables: t: Fin 2 → ℤ
name: v
Hypotheses: t: Finset (Fin 2 → ℤ)
name: P
t: Finset (Fin 2 → ℤ)
name: Pvdiff
t: P = {v' : Fin 2 → ℤ | 0 ≤ v' 0 ∧ v' 0 ≤ 2 ∧ 0 ≤ v' 1 ∧ v' 1 ≤ 100}
name: hP
t: Pvdiff = P \ ({v} : Finset (Fin 2 → ℤ))
name: hPvdiff
Conclusions: ((v ∈ P ∧ (∃ Q R : Finset (Fin 2 → ℤ),
    (Q ∪ R = Pvdiff) ∧ (Q ∩ R = ∅) ∧ (Q.card = R.card) ∧
    (∑ q in Q, q 0 = ∑ r in R, r 0) ∧ (∑ q in Q, q 1 = ∑ r in R, r 1)))
  ↔ v ∈ answer)
Answer type: Set (Fin 2 → ℤ)
Formal answer: answer =
  ({v : Fin (2 : ℕ) → ℤ |
      ∃ (b : ℤ),
        (0 : ℤ) ≤ b ∧
          b ≤ (100 : ℤ) ∧
            Even b ∧
              v =
                (Matrix.vecCons (1 : ℤ) (Matrix.vecCons b (![] : Fin (0 : ℕ) → ℤ) : Fin (Nat.succ (0 : ℕ) : ℕ) → ℤ) :
                  Fin ((Nat.succ (0 : ℕ) : ℕ).succ : ℕ) → ℤ)} :
    Set (Fin (2 : ℕ) → ℤ))
Problem: Find all positive integers $n < 10^{100}$ for which simultaneously $n$ divides $2^n$, $n-1$ divides $2^n-1$, and $n-2$ divides $2^n - 2$.

Answer: {2^2, 2^4, 2^16, 2^256}

Lean 4 formalization:
Hypotheses: t: ℕ
name: n
t: 0 < n
name: hn
Conclusions: ((n < 10^100 ∧ ((n : ℤ) ∣ (2^n : ℤ) ∧ (n - 1 : ℤ) ∣ (2^n - 1 : ℤ) ∧ (n - 2 : ℤ) ∣ (2^n - 2 : ℤ))) ↔ n ∈ answer)
Answer type: Set ℕ
Formal answer: answer =
  (Insert.insert ((2 : ℕ) ^ (2 : ℕ) : ℕ)
      (Insert.insert ((2 : ℕ) ^ (4 : ℕ) : ℕ)
          (Insert.insert ((2 : ℕ) ^ (16 : ℕ) : ℕ) ({((2 : ℕ) ^ (256 : ℕ) : ℕ)} : Set ℕ) : Set ℕ) :
        Set ℕ) :
    Set ℕ)
Problem: Determine all possible values of the expression
\[
A^3+B^3+C^3-3ABC
\]
where $A, B$, and $C$ are nonnegative integers.

Answer: the set of nonnegative integers not congruent to 3 or 6 modulo 9

Lean 4 formalization:
open Topology Filter
Conclusions: ({n : ℤ | ∃ A B C : ℤ, A ≥ 0 ∧ B ≥ 0 ∧ C ≥ 0 ∧ A^3 + B^3 + C^3 - 3*A*B*C = n} = answer)
Answer type: Set ℤ
Formal answer: answer = ({n : ℤ | n ≥ (0 : ℤ) ∧ ¬n ≡ (3 : ℤ) [ZMOD (9 : ℤ)] ∧ ¬n ≡ (6 : ℤ) [ZMOD (9 : ℤ)]} : Set ℤ)
Problem: Given real numbers $b_0, b_1, \dots, b_{2019}$ with $b_{2019} \neq 0$, let $z_1,z_2,\dots,z_{2019}$ be
the roots in the complex plane of the polynomial
\[
P(z) = \sum_{k=0}^{2019} b_k z^k.
\]
Let $\mu = (|z_1| + \cdots + |z_{2019}|)/2019$ be the average of the distances from $z_1,z_2,\dots,z_{2019}$ to the origin. Determine the largest constant $M$ such that $\mu \geq M$ for all choices of $b_0,b_1,\dots, b_{2019}$ that satisfy
\[
1 \leq b_0 < b_1 < b_2 < \cdots < b_{2019} \leq 2019.
\]

Answer: 2019^(-(1:ℝ)/2019)

Lean 4 formalization:
open Topology Filter
Hypotheses: t: Polynomial ℂ → Prop
name: v
t: v = fun b => b.degree = 2019 ∧ 1 ≤ (b.coeff 0).re ∧ (b.coeff 2019).re ≤ 2019 ∧
  (∀ i : Fin 2020, (b.coeff i).im = 0) ∧ (∀ i : Fin 2019, (b.coeff i).re < (b.coeff (i + 1)).re)
name: hv
t: Polynomial ℂ → ℝ
name: μ
t: μ = fun b => (Multiset.map (fun ω : ℂ => ‖ω‖) (Polynomial.roots b)).sum/2019
name: hμ
Conclusions: (IsGreatest {M : ℝ | ∀ b, v b → μ b ≥ M} answer)
Answer type: ℝ
Formal answer: answer = ((2019 : ℝ) ^ (-1 / 2019 : ℝ) : ℝ)
Problem: Let $f$ be a continuous real-valued function on $\mathbb{R}^3$. Suppose that for every sphere $S$ of radius $1$, the integral of $f(x,y,z)$ over the surface of $S$ equals $0$. Must $f(x,y,z)$ be identically 0?

Answer: False

Lean 4 formalization:
open MeasureTheory Metric Topology Filter
Hypotheses: t: (EuclideanSpace ℝ (Fin 3) → ℝ) → Prop
name: P
t: ∀ f, P f ↔ ∀ C, ∫ x in sphere C 1, f x ∂μH[2] = 0
name: P_def
Conclusions: ((∀ f, Continuous f → P f → f = 0) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Let $p$ be an odd prime number, and let $\mathbb{F}_p$ denote the field of integers modulo $p$. Let $\mathbb{F}_p[x]$ be the ring of polynomials over $\mathbb{F}_p$, and let $q(x) \in \mathbb{F}_p[x]$ be given by $q(x)=\sum_{k=1}^{p-1} a_kx^k$, where $a_k=k^{(p-1)/2}\mod{p}$. Find the greatest nonnegative integer $n$ such that $(x-1)^n$ divides $q(x)$ in $\mathbb{F}_p[x]$.

Answer: (p - 1) / 2

Lean 4 formalization:
open Topology Filter
Independent variables: t: ℕ
name: p
Hypotheses: t: Polynomial (ZMod p)
name: q
t: ℕ → ZMod p
name: a
t: ℕ → Polynomial (ZMod p)
name: npoly
t: Odd p
name: podd
t: p.Prime
name: pprime
t: ∀ k : ℕ, q.coeff k = a k
name: hq
t: a 0 = 0 ∧ ∀ k > p - 1, a k = 0
name: ha0
t: ∀ k : Set.Icc 1 (p - 1), a k = ((k : ℕ) ^ ((p - 1) / 2)) % p
name: haother
t: ∀ n x, (npoly n).eval x = (x - 1) ^ n
name: hnpoly
Conclusions: (IsGreatest {n | npoly n ∣ q} (answer p))
Answer type: ℕ → ℕ
Formal answer: answer = fun (p : ℕ) => ((p - (1 : ℕ) : ℕ) / (2 : ℕ) : ℕ)
Problem: Denote by $\mathbb{Z}^2$ the set of all points $(x,y)$ in the plane with integer coordinates. For each integer $n \geq 0$, let $P_n$ be the subset of $\mathbb{Z}^2$ consisting of the point $(0,0)$ together with all points $(x,y)$ such that $x^2+y^2=2^k$ for some integer $k \leq n$. Determine, as a function of $n$, the number of four-point subsets of $P_n$ whose elements are the vertices of a square.

Answer: 5n + 1

Lean 4 formalization:
open Topology Filter
Independent variables: t: ℕ
name: n
Hypotheses: t: Set (Fin 2 → ℤ)
name: Pn
t: (Fin 2 → ℤ) → EuclideanSpace ℝ (Fin 2)
name: pZtoR
t: Finset (Fin 2 → ℤ) → Prop
name: sPnsquare
t: Pn = {p | (p 0 = 0 ∧ p 1 = 0) ∨ (∃ k ≤ n, (p 0) ^ 2 + (p 1) ^ 2 = 2 ^ k)}
name: hPn
t: ∀ p i, (pZtoR p) i = p i
name: hpZtoR
t: ∀ sPn : Finset (Fin 2 → ℤ), sPnsquare sPn ↔ (sPn.card = 4 ∧ ∃ p4 : Fin 4 → (Fin 2 → ℤ), Set.range p4 = sPn ∧ (∃ s > 0, ∀ i : Fin 4, dist (pZtoR (p4 i) : EuclideanSpace ℝ (Fin 2)) (pZtoR (p4 (i + 1))) = s) ∧ (dist (pZtoR (p4 0)) (pZtoR (p4 2)) = dist (pZtoR (p4 1)) (pZtoR (p4 3))))
name: sPnsquare_def
Conclusions: ({sPn : Finset (Fin 2 → ℤ) | (sPn : Set (Fin 2 → ℤ)) ⊆ Pn ∧ sPnsquare sPn}.encard = answer n)
Answer type: ℕ → ℕ
Formal answer: answer = fun (n : ℕ) => (((5 : ℕ) * n : ℕ) + (1 : ℕ) : ℕ)
Problem: For all $n \geq 1$, let
\[
a_n = \sum_{k=1}^{n-1} \frac{\sin \left( \frac{(2k-1)\pi}{2n} \right)}{\cos^2 \left( \frac{(k-1)\pi}{2n} \right) \cos^2 \left( \frac{k\pi}{2n} \right)}.
\]
Determine
\[
\lim_{n \to \infty} \frac{a_n}{n^3}.
\]

Answer: 8/π^3

Lean 4 formalization:
open Topology Filter Set
Hypotheses: t: ℕ → ℝ
name: a
t: a = fun n : ℕ => ∑ k : Icc (1 : ℤ) (n - 1),
Real.sin ((2*k - 1)*Real.pi/(2*n))/((Real.cos ((k - 1)*Real.pi/(2*n))^2)*(Real.cos (k*Real.pi/(2*n))^2))
name: ha
Conclusions: (Tendsto (fun n : ℕ => (a n)/n^3) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = ((8 : ℝ) / ((Real.pi : ℝ) ^ (3 : ℕ) : ℝ) : ℝ)
Problem: Let $\mathcal{F}$ be the set of functions $f(x,y)$ that are twice continuously differentiable for $x \geq 1,y \geq 1$ and that satisfy the following two equations (where subscripts denote partial derivatives):
\begin{gather*}
xf_x+yf_y=xy\ln(xy), \\
x^2f_{xx}+y^2f_{yy}=xy.
\end{gather*}
For each $f \in \mathcal{F}$, let $m(f)=\min_{s \geq 1} (f(s+1,s+1)-f(s+1,s)-f(s,s+1)+f(s,s))$. Determine $m(f)$, and show that it is independent of the choice of $f$.

Answer: $2 \ln 2 - \frac{1}{2}$

Lean 4 formalization:
open Topology Filter Set Matrix
Hypotheses: t: (Fin 2 → ℝ) → ℝ
name: f
t: ℝ → ℝ → (Fin 2 → ℝ)
name: vec
t: ContDiff ℝ 2 f
name: fdiff
t: ∀ x y : ℝ, (vec x y) 0 = x ∧ (vec x y 1) = y
name: hvec
t: ∀ x ≥ 1, ∀ y ≥ 1, x * deriv (fun x' : ℝ => f (vec x' y)) x + y * deriv (fun y' : ℝ => f (vec x y')) y = x * y * Real.log (x * y)
name: feq1
t: ∀ x ≥ 1, ∀ y ≥ 1, x ^ 2 * iteratedDeriv 2 (fun x' : ℝ => f (vec x' y)) x + y ^ 2 * iteratedDeriv 2 (fun y' : ℝ => f (vec x y')) y = x * y
name: feq2
Conclusions: (sInf {f (vec (s + 1) (s + 1)) - f (vec (s + 1) s) - f (vec s (s + 1)) + f (vec s s) | s ≥ 1} = answer)
Answer type: ℝ
Formal answer: answer = (((2 : ℝ) * (Real.log (2 : ℝ) : ℝ) : ℝ) - (1 / 2 : ℝ) : ℝ)
Problem: Let $F_m$ be the $m$th Fibonacci number, defined by $F_1 = F_2 = 1$ and $F_m = F_{m-1} + F_{m-2}$ for all $m \geq 3$. Let $p(x)$ be the polynomial of degree $1008$ such that $p(2n + 1) = F_{2n+1}$ for $n = 0,1,2,\ldots,1008$. Find integers $j$ and $k$ such that $p(2019) = F_j - F_k$.

Answer: ⟨2019, 1010⟩

Lean 4 formalization:
open Topology Filter Set Matrix
Hypotheses: t: ℕ → ℤ
name: F
t: Polynomial ℝ
name: P
t: ∀ x, x ≥ 1 → F (x + 2) = F (x + 1) + F x
name: hF
t: F 1 = 1 ∧ F 2 = 1
name: F12
t: Polynomial.degree P = 1008
name: Pdeg
t: ∀ n : ℕ, (n ≤ 1008) → P.eval (2 * n + 1 : ℝ) = F (2 * n + 1)
name: hp
Conclusions: (∀ j k : ℕ, (P.eval 2019 = F j - F k) ↔ ⟨j, k⟩ = answer)
Answer type: ℕ × ℕ
Formal answer: answer = (((2019 : ℕ), (1010 : ℕ)) : ℕ × ℕ)
Problem: Let \( \mathbb{Z}^n \) be the integer lattice in \( \mathbb{R}^n \). Two points in \( \mathbb{Z}^n \) are called neighbors if they differ by exactly 1 in one coordinate and are equal in all other coordinates. For which integers \( n \geq 1 \) does there exist a set of points \( S \subset \mathbb{Z}^n \) satisfying the following two conditions? \begin{enumerate} \item If \( p \) is in \( S \), then none of the neighbors of \( p \) is in \( S \). \item If \( p \in \mathbb{Z}^n \) is not in \( S \), then exactly one of the neighbors of \( p \) is in \( S \). \end{enumerate}

Answer: the set of all integers n ≥ 1

Lean 4 formalization:
open Topology Filter Set Matrix
Hypotheses: t: ℕ
name: n
t: (Fin n → ℤ) → (Fin n → ℤ) → Prop
name: neighbors
t: ∀ p q, neighbors p q ↔ (∃ i : Fin n, abs (p i - q i) = 1 ∧ ∀ j ≠ i, p j = q j)
name: neighbors_def
Conclusions: ((1 ≤ n ∧ ∃ S : Set (Fin n → ℤ),
    (∀ p ∈ S, ∀ q, neighbors p q → q ∉ S) ∧ (∀ p ∉ S, {q ∈ S | neighbors p q}.encard = 1)) ↔ n ∈ answer)
Answer type: Set ℕ
Formal answer: answer = (Set.Ici (1 : ℕ) : Set ℕ)
Problem: Find the number of positive integers $N$ satisfying: (i) $N$ is divisible by $2020$, (ii) $N$ has at most $2020$ decimal digits, (iii) The decimal digits of $N$ are a string of consecutive ones followed by a string of consecutive zeros.

Answer: 508536

Lean 4 formalization:
Conclusions: (Set.ncard {x : ℕ | (2020 ∣ x) ∧ (Nat.log 10 x) + 1 ≤ 2020 ∧ (∃ k l, k ≥ l ∧ x = ∑ i in Finset.range (k - l + 1), 10 ^ (i + l))} = answer)
Answer type: ℕ
Formal answer: answer = (508536 : ℕ)
Problem: Let $k$ be a nonnegative integer. Evaluate
\[
\sum_{j=0}^k 2^{k-j} \binom{k+j}{j}.
\]

Answer: 4^k

Lean 4 formalization:
Independent variables: t: ℕ
name: k
Conclusions: ((∑ j in Finset.Icc 0 k, 2 ^ (k - j) * Nat.choose (k + j) j) = answer k)
Answer type: ℕ → ℕ
Formal answer: answer = fun (k : ℕ) => ((4 : ℕ) ^ k : ℕ)
Problem: Let $a_0 = \pi/2$, and let $a_n = \sin(a_{n-1})$ for $n \geq 1$. Determine whether
\[
\sum_{n=1}^\infty a_n^2
\]
converges.

Answer: False

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℕ → ℝ
name: a
t: a 0 = Real.pi / 2
name: ha0
t: ∀ n, a (n+1) = Real.sin (a n)
name: ha
Conclusions: ((∃ L, Tendsto (fun m : ℕ => ∑ n in Finset.Icc 1 m, (a n)^2) atTop (𝓝 L)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Let $a_n$ be the number of sets $S$ of positive integers for which
\[
\sum_{k \in S} F_k = n,
\]
where the Fibonacci sequence $(F_k)_{k \geq 1}$ satisfies $F_{k+2} = F_{k+1} + F_k$ and begins $F_1 = 1, F_2 = 1, F_3 = 2, F_4 = 3$. Find the largest integer $n$ such that $a_n = 2020$.

Answer: (Nat.fib 4040) - 1

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℤ → ℕ
name: a
t: a = fun n : ℤ => {S : Finset ℕ | (∀ k ∈ S, k > 0) ∧ ∑ k : S, Nat.fib k = n}.ncard
name: ha
Conclusions: (IsGreatest {n | a n = 2020} answer)
Answer type: ℤ
Formal answer: answer = ((↑(Nat.fib (4040 : ℕ) : ℕ) : ℤ) - (1 : ℤ) : ℤ)
Problem: For a positive integer $N$, let $f_N$ be the function defined by
\[
f_N(x) = \sum_{n=0}^N \frac{N+1/2-n}{(N+1)(2n+1)} \sin((2n+1)x).
\]
Determine the smallest constant $M$ such that $f_N(x) \leq M$ for all $N$ and all real $x$.

Answer: π/4

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℤ → (ℝ → ℝ)
name: f
t: f = fun N : ℤ => fun x : ℝ =>
    ∑ n in Finset.Icc 0 N, (N + 1/2 - n)/((N + 1)*(2*n + 1)) * Real.sin ((2*n + 1)*x)
name: hf
Conclusions: (answer = sSup {y | ∃ᵉ (N > 0) (x : ℝ), y = f N x})
Answer type: ℝ
Formal answer: answer = ((Real.pi : ℝ) / (4 : ℝ) : ℝ)
Problem: For a positive integer $n$, define $d(n)$ to be the sum of the digits of $n$ when written in binary (for example, $d(13) = 1+1+0+1=3)$. Let
\[
S = \sum_{k=1}^{2020} (-1)^{d(k)} k^3.
\]
Determine $S$ modulo 2020.

Answer: 1990

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℕ → ℕ
name: d
t: ℤ
name: S
t: d = fun n : ℕ => ∑ i : Fin (Nat.digits 2 n).length, (Nat.digits 2 n)[i]!
name: hd
t: S = ∑ k : Icc 1 2020, ((-1 : ℤ)^(d k))*(k : ℤ)^3
name: hS
Conclusions: (S % 2020 = answer)
Answer type: ℕ
Formal answer: answer = (1990 : ℕ)
Problem: Let $n$ be a positive integer, and let $V_n$ be the set of integer $(2n+1)$-tuples $\mathbf{v} = (s_0, s_1, \cdots, s_{2n-1}, s_{2n})$ for which $s_0 = s_{2n} = 0$ and $|s_j - s_{j-1}| = 1$ for $j=1,2,\cdots,2n$. Define \[ q(\mathbf{v}) = 1 + \sum_{j=1}^{2n-1} 3^{s_j}, \] and let $M(n)$ be the average of $\frac{1}{q(\mathbf{v})}$ over all $\mathbf{v} \in V_n$. Evaluate $M(2020)$.

Answer: 1 / 4040

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℕ → Set (ℕ → ℤ)
name: V
t: ℕ → (ℕ → ℤ) → ℝ
name: q
t: ℕ → ℝ
name: M
t: V = fun n ↦ ({s : ℕ → ℤ | s 0 = 0 ∧ (∀ j ≥ 2 * n, s j = 0) ∧ (∀ j ∈ Icc 1 (2 * n), |s j - s (j - 1)| = 1)})
name: hV
t: q = fun n s ↦ 1 + ∑ j in Finset.Icc 1 (2 * n - 1), 3 ^ (s j)
name: hq
t: M = fun n ↦ (∑' v : V n, 1 / (q n v)) / (V n).ncard
name: hM
Conclusions: (M 2020 = answer)
Answer type: ℝ
Formal answer: answer = (1 / 4040 : ℝ)
Problem: A grasshopper starts at the origin in the coordinate plane and makes a sequence of hops.
Each hop has length $5$, and after each hop the grasshopper is at a point whose coordinates are both integers; thus, there are $12$ possible locations for the grasshopper after the first hop.
What is the smallest number of hops needed for the grasshopper to reach the point $(2021, 2021)$?

Answer: 578

Lean 4 formalization:
open Filter Topology
Hypotheses: t: List (ℤ × ℤ) → Prop
name: P
t: ∀ l, P l ↔ l.Chain' fun p q ↦ (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 = 25
name: P_def
Conclusions: (IsLeast
      {k | ∃ l, P ((0, 0) :: l) ∧ l.getLast! = (2021, 2021) ∧ l.length = k}
      answer)
Answer type: ℕ
Formal answer: answer = (578 : ℕ)
Problem: For every positive real number $x$, let $g(x)=\lim_{r \to 0}((x+1)^{r+1}-x^{r+1})^\frac{1}{r}$. Find $\lim_{x \to \infty}\frac{g(x)}{x}$.

Answer: Real.exp 1

Lean 4 formalization:
open Filter Topology
Hypotheses: t: ℝ → ℝ
name: g
t: ∀ x > 0, Tendsto (fun r : ℝ => ((x + 1) ^ (r + 1) - x ^ (r + 1)) ^ (1 / r)) (𝓝[>] 0) (𝓝 (g x))
name: hg
Conclusions: (Tendsto (fun x : ℝ => g x / x) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (Real.exp (1 : ℝ) : ℝ)