purewhite42/putnambench_solving huggingface dataset:
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:
Independent variables:
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
Conclusion:
((∃ n : ℕ, List.IsPrefix [5, 1, 0, 2] (Nat.digits 10 (sums n))) ↔ answer)
Formal answer (type: Prop):
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:
Independent variables:
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
Conclusion:
(M ∈ S ∧ (∃ k > 1, M ^ k ∈ S) ↔ M ∈ answer)
Formal answer (type: Set (Matrix (Fin 2) (Fin 2) ℝ)):
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:
Independent variables:
Hypotheses:
t: ℚ → (ℤ × ℕ)
name: quotientof
t: ∀ q : ℚ, quotientof q = (q.num, q.den)
name: hquotientof
Conclusion:
(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)
Formal answer (type: ℤ × ℕ):
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
Independent variables:
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
Conclusion:
(∀ n : ℕ, n ≥ 2 → (P (n + 5) : ℤ) - (P (n + 4) : ℤ) - (P (n + 3) : ℤ) + (P n : ℤ) = answer)
Formal answer (type: ℕ):
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
Independent variables:
Hypotheses:
t: ℕ → ℕ
name: A
t: ∀ k > 0, A k = {j : ℕ | Odd j ∧ j ∣ k ∧ j < Real.sqrt (2 * k)}.encard
name: hA
Conclusion:
(Tendsto (fun K : ℕ ↦ ∑ k in Finset.Icc 1 K, (-1 : ℝ) ^ ((k : ℝ) - 1) * (A k / (k : ℝ))) atTop (𝓝 answer))
Formal answer (type: ℝ):
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
Independent variables:
Hypotheses:
Conclusion:
(IsLeast {j : ℕ | 0 < j ∧ ∀ P : ℤ[X], ∀ k : ℤ, 2016 ∣ (derivative^[j] P).eval k} answer)
Formal answer (type: ℕ):
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
Independent variables:
Hypotheses:
t: ℕ → ℕ
name: M
t: ∀ n > 0, IsGreatest {m | 0 < m ∧ (m - 1).choose n < m.choose (n - 1)} (M n)
name: hM
Conclusion:
(Tendsto (fun n ↦ M n / (n : ℝ)) atTop (𝓝 answer))
Formal answer (type: ℝ):
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
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
t: ∀ x : ℝ, x ≠ 0 → f x + f (1 - 1 / x) = Real.arctan x
name: hf
Conclusion:
(∫ x in (0)..1, f x = answer)
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(IsLeast p answer)
Formal answer (type: ℝ):
answer = (5 / 6 : ℝ)
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
Independent variables:
Hypotheses:
t: ℕ → ℝ
name: x
t: x 0 = 1
name: hx0
t: ∀ n : ℕ, x (n + 1) = log (exp (x n) - (x n))
name: hxn
Conclusion:
(∑' n : ℕ, x n = answer)
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
((∀ α β : ℝ, ((α, β) = answer ↔ p α β)) ∨ ¬∃ α β : ℝ, p α β)
Formal answer (type: ℝ × ℝ):
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
Conclusion:
((∑' A : mats01, (A.1 - (Matrix.transpose A)).det) / mats01.ncard = answer n)
Formal answer (type: ℕ → ℝ):
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
Hypotheses:
Conclusion:
(f ∈ answer ↔
    (∀ x y : Set.Ioi (1 : ℝ), ((x : ℝ) ^ 2 ≤ y ∧ y ≤ (x : ℝ) ^ 3) → ((f x : ℝ) ^ 2 ≤ f y ∧ f y ≤ (f x : ℝ) ^ 3)))
Formal answer (type: Set (Set.Ioi (1 : ℝ) → Set.Ioi (1 : ℝ))):
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
Independent variables:
Hypotheses:
Conclusion:
(∑' k : ℕ, ((-1 : ℝ) ^ ((k + 1 : ℤ) - 1) / (k + 1 : ℝ)) * ∑' n : ℕ, (1 : ℝ) / ((k + 1) * (2 ^ n) + 1) = answer)
Formal answer (type: ℝ):
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:
Independent variables:
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
Conclusion:
(Sᶜ ∩ {n | 0 < n} = answer)
Formal answer (type: Set ℤ):
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
Independent variables:
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
Conclusion:
(IsLeast {a : ℤ | q (S a 2017)} answer)
Formal answer (type: ℕ):
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
Independent variables:
Hypotheses:
Conclusion:
((∑' 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))
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(S.card = answer)
Formal answer (type: ℕ):
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:
Independent variables:
Hypotheses:
t: ℤ
name: a
t: ℤ
name: b
t: 0 < a ∧ 0 < b
name: h
Conclusion:
(((1 : ℚ) / a + (1 : ℚ) / b = (3 : ℚ) / 2018) ↔ (⟨a, b⟩ ∈ answer))
Formal answer (type: Set (ℤ × ℤ)):
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
Conclusion:
(M.det = answer n)
Formal answer (type: ℕ → ℝ):
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:
Independent variables:
Hypotheses:
Conclusion:
(IsGreatest
      {∑ i, Real.cos (3 * x i) | (x : Fin 10 → ℝ) (hx : ∑ i, Real.cos (x i) = 0)}
      answer)
Formal answer (type: ℝ):
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
Conclusion:
((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)
Formal answer (type: Set (Fin 2 → ℤ)):
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:
Independent variables:
Hypotheses:
t: ℕ
name: n
t: 0 < n
name: hn
Conclusion:
((n < 10^100 ∧ ((n : ℤ) ∣ (2^n : ℤ) ∧ (n - 1 : ℤ) ∣ (2^n - 1 : ℤ) ∧ (n - 2 : ℤ) ∣ (2^n - 2 : ℤ))) ↔ n ∈ answer)
Formal answer (type: Set ℕ):
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
Independent variables:
Hypotheses:
Conclusion:
({n : ℤ | ∃ A B C : ℤ, A ≥ 0 ∧ B ≥ 0 ∧ C ≥ 0 ∧ A^3 + B^3 + C^3 - 3*A*B*C = n} = answer)
Formal answer (type: Set ℤ):
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
Independent variables:
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μ
Conclusion:
(IsGreatest {M : ℝ | ∀ b, v b → μ b ≥ M} answer)
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
((∀ f, Continuous f → P f → f = 0) ↔ answer)
Formal answer (type: Prop):
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
Conclusion:
(IsGreatest {n | npoly n ∣ q} (answer p))
Formal answer (type: ℕ → ℕ):
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
Conclusion:
({sPn : Finset (Fin 2 → ℤ) | (sPn : Set (Fin 2 → ℤ)) ⊆ Pn ∧ sPnsquare sPn}.encard = answer n)
Formal answer (type: ℕ → ℕ):
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
Independent variables:
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
Conclusion:
(Tendsto (fun n : ℕ => (a n)/n^3) atTop (𝓝 answer))
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(sInf {f (vec (s + 1) (s + 1)) - f (vec (s + 1) s) - f (vec s (s + 1)) + f (vec s s) | s ≥ 1} = answer)
Formal answer (type: ℝ):
answer = (((2 : ℝ) * (Real.log (2 : ℝ) : ℝ) : ℝ) - (1 / 2 : ℝ) : ℝ)