purewhite42/putnambench_solving huggingface dataset:
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
Independent variables:
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
Conclusion:
(∀ j k : ℕ, (P.eval 2019 = F j - F k) ↔ ⟨j, k⟩ = answer)
Formal answer (type: ℕ × ℕ):
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
Independent variables:
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
Conclusion:
((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)
Formal answer (type: Set ℕ):
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:
Independent variables:
Hypotheses:
Conclusion:
(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)
Formal answer (type: ℕ):
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
Hypotheses:
Conclusion:
((∑ j in Finset.Icc 0 k, 2 ^ (k - j) * Nat.choose (k + j) j) = answer k)
Formal answer (type: ℕ → ℕ):
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
Independent variables:
Hypotheses:
t: ℕ → ℝ
name: a
t: a 0 = Real.pi / 2
name: ha0
t: ∀ n, a (n+1) = Real.sin (a n)
name: ha
Conclusion:
((∃ L, Tendsto (fun m : ℕ => ∑ n in Finset.Icc 1 m, (a n)^2) atTop (𝓝 L)) ↔ answer)
Formal answer (type: Prop):
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
Independent variables:
Hypotheses:
t: ℤ → ℕ
name: a
t: a = fun n : ℤ => {S : Finset ℕ | (∀ k ∈ S, k > 0) ∧ ∑ k : S, Nat.fib k = n}.ncard
name: ha
Conclusion:
(IsGreatest {n | a n = 2020} answer)
Formal answer (type: ℤ):
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
Independent variables:
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
Conclusion:
(answer = sSup {y | ∃ᵉ (N > 0) (x : ℝ), y = f N x})
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(S % 2020 = answer)
Formal answer (type: ℕ):
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
Independent variables:
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
Conclusion:
(M 2020 = answer)
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(IsLeast
      {k | ∃ l, P ((0, 0) :: l) ∧ l.getLast! = (2021, 2021) ∧ l.length = k}
      answer)
Formal answer (type: ℕ):
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
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: g
t: ∀ x > 0, Tendsto (fun r : ℝ => ((x + 1) ^ (r + 1) - x ^ (r + 1)) ^ (1 / r)) (𝓝[>] 0) (𝓝 (g x))
name: hg
Conclusion:
(Tendsto (fun x : ℝ => g x / x) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (Real.exp (1 : ℝ) : ℝ)
Problem: Determine all positive integers $N$ for which the sphere $x^2+y^2+z^2=N$ has an inscribed regular tetrahedron whose vertices have integer coordinates.

Answer: {3 * m ^ 2 | m > 0}

Lean 4 formalization:
open Filter Topology
Independent variables:
Hypotheses:
t: ℕ
name: N
t: Set (EuclideanSpace ℝ (Fin 3))
name: Nsphere
t: Nsphere = {p | (p 0) ^ 2 + (p 1) ^ 2 + (p 2) ^ 2 = (N : ℝ)}
name: hNsphere
t: (EuclideanSpace ℝ (Fin 3)) → Prop
name: intcoords
t: ∀ p, intcoords p ↔ ∀ i : Fin 3, p i = round (p i)
name: intcoords_def
Conclusion:
((0 < N ∧ ∃ A B C D : EuclideanSpace ℝ (Fin 3),
    A ∈ Nsphere ∧ B ∈ Nsphere ∧ C ∈ Nsphere ∧ D ∈ Nsphere ∧
    intcoords A ∧ intcoords B ∧ intcoords C ∧ intcoords D ∧
    (∃ s > 0, dist A B = s ∧ dist A C = s ∧ dist A D = s ∧ dist B C = s ∧ dist B D = s ∧ dist C D = s))
  ↔ N ∈ answer)
Formal answer (type: Set ℕ):
answer = ({x : ℕ | ∃ m > (0 : ℕ), ((3 : ℕ) * (m ^ (2 : ℕ) : ℕ) : ℕ) = x} : Set ℕ)
Problem: Let
\[
I(R) = \iint_{x^2+y^2 \leq R^2} \left( \frac{1+2x^2}{1+x^4+6x^2y^2+y^4} - \frac{1+y^2}{2+x^4+y^4} \right)\,dx\,dy.
\]
Find
\[
\lim_{R \to \infty} I(R),
\]
or show that this limit does not exist.

Answer: $\frac{\sqrt{2}}{2} \pi \log 2$

Lean 4 formalization:
open Filter Topology Metric
Independent variables:
Hypotheses:
t: ℝ → Set (EuclideanSpace ℝ (Fin 2))
name: S
t: S = fun R => ball (0 : EuclideanSpace ℝ (Fin 2)) R
name: hS
t: ℝ → ℝ
name: I
t: I = fun R => ∫ p in S R,
    (1 + 2*(p 0)^2)/(1 + (p 0)^4 + 6*(p 0)^2*(p 1)^2 + (p 1)^4) - (1 + (p 1)^2)/(2 + (p 0)^4 + (p 1)^4)
name: hI
Conclusion:
(Tendsto I atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = ((((√(2 : ℝ) : ℝ) / (2 : ℝ) : ℝ) * (Real.pi : ℝ) : ℝ) * (Real.log (2 : ℝ) : ℝ) : ℝ)
Problem: Let $A$ be the set of all integers $n$ such that $1 \leq n \leq 2021$ and $\gcd(n,2021)=1$. For every nonnegative integer $j$, let $S(j)=\sum_{n \in A}n^j$. Determine all values of $j$ such that $S(j)$ is a multiple of $2021$.

Answer: the set of all j such that neither 42 nor 46 divides j

Lean 4 formalization:
open Filter Topology
Independent variables:
t: ℕ
name: j
Hypotheses:
t: Finset ℕ
name: A
t: ℕ → ℕ
name: S
t: A = {n | 1 ≤ n ∧ n ≤ 2021 ∧ Nat.gcd n 2021 = 1}
name: hA
t: ∀ j' : ℕ, S j' = ∑ n in A, n ^ j'
name: hS
Conclusion:
((2021 ∣ S j) ↔ j ∈ answer)
Formal answer (type: Set ℕ):
answer = ({j : ℕ | ¬(42 : ℕ) ∣ j ∧ ¬(46 : ℕ) ∣ j} : Set ℕ)
Problem: Let $P(x)$ be a polynomial whose coefficients are all either $0$ or $1$. Suppose that $P(x)$ can be written as a product of two nonconstant polynomials with integer coefficients. Does it follow that $P(2)$ is a composite integer?

Answer: True

Lean 4 formalization:
open Filter Topology
Independent variables:
Hypotheses:
Conclusion:
((∀ P, (∀ n : ℕ, P.coeff n = 0 ∨ P.coeff n = 1) →
    (∃ Q R : Polynomial ℤ, Q.degree > 0 ∧ R.degree > 0 ∧ P = Q * R) →
    (P.eval 2 ≠ 0 ∧ P.eval 2 ≠ 1 ∧ ¬Prime (P.eval 2)))
  ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Determine the maximum value of the sum $S = \sum_{n=1}^\infty \frac{n}{2^n}(a_1a_2 \dots a_n)^{1/n}$ over all sequences $a_1,a_2,a_3,\dots$ of nonnegative real numbers satisfying $\sum_{k=1}^\infty a_k=1$.

Answer: 2 / 3

Lean 4 formalization:
open Filter Topology
Independent variables:
Hypotheses:
Conclusion:
(IsGreatest
      {S | ∃ a : ℕ+ → ℝ, (∑' k, a k = 1) ∧ (∀ k, 0 ≤ a k) ∧
        S = ∑' n : ℕ+, n / 2 ^ (n : ℕ) * (∏ k in Finset.Icc 1 n, a k) ^ (1 / n : ℝ)}
      answer)
Formal answer (type: ℝ):
answer = (2 / 3 : ℝ)
Problem: Let $h(x,y)$ be a real-valued function that is twice continuously differentiable throughout $\mathbb{R}^2$, and define $\rho(x,y)=yh_x-xh_y$. Prove or disprove: For any positive constants $d$ and $r$ with $d>r$, there is a circle $\mathcal{S}$ of radius $r$ whose center is a distance $d$ away from the origin such that the integral of $\rho$ over the interior of $\mathcal{S}$ is zero.

Answer: True

Lean 4 formalization:
open Filter Topology Metric
Independent variables:
Hypotheses:
t: ((EuclideanSpace ℝ (Fin 2)) → ℝ) → (EuclideanSpace ℝ (Fin 2)) → ℝ
name: rho
t: ∀ (h : (EuclideanSpace ℝ (Fin 2)) → ℝ) (p : EuclideanSpace ℝ (Fin 2)),
    rho h p = (p 1) *
      deriv (fun x' : ℝ => h ((WithLp.equiv 2 (EuclideanSpace ℝ (Fin 2))).symm ![x', p 1])) (p 0)
      - (p 0) * deriv (fun y' : ℝ => h ((WithLp.equiv 2 (EuclideanSpace ℝ (Fin 2))).symm ![p 0, y'])) (p 1)
name: rho_def
Conclusion:
((∀ h : (EuclideanSpace ℝ (Fin 2)) → ℝ, ContDiff ℝ 2 h →
    (∀ d > 0, ∀ r > 0, d > r → (∃ c : EuclideanSpace ℝ (Fin 2), dist c 0 = d ∧ (∫ p in (ball c r), rho h p) = 0))) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Determine all ordered pairs of real numbers $(a,b)$ such that the line $y = ax+b$ intersects the curve $y = \ln(1+x^2)$ in exactly one point.

Answer: {(a, b) | (a = 0 ∧ b = 0) ∨ 1 ≤ |a| ∨ (0 < |a| ∧ |a| < 1 ∧ letI rm := (1 - √(1 - a ^ 2)) / a; letI rp := (1 + √(1 - a ^ 2)) / a; (b < Real.log (1 + rm ^ 2) - a * rm ∨ b > Real.log (1 + rp ^ 2) - a * rp))}

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
Conclusion:
({a : (ℝ × ℝ) | ∃! x : ℝ, a.1 * x + a.2 = Real.log (1 + x^2)} = answer)
Formal answer (type: Set (ℝ × ℝ)):
answer =
  ({((a, b) : ℝ × ℝ) : ℝ × ℝ |
      a = (0 : ℝ) ∧ b = (0 : ℝ) ∨
        (1 : ℝ) ≤ (|a| : ℝ) ∨
          (0 : ℝ) < (|a| : ℝ) ∧
            (|a| : ℝ) < (1 : ℝ) ∧
              (b <
                  ((Real.log
                          ((1 : ℝ) +
                              ((((1 : ℝ) - (√((1 : ℝ) - (a ^ (2 : ℕ) : ℝ) : ℝ) : ℝ) : ℝ) / a : ℝ) ^ (2 : ℕ) : ℝ) :
                            ℝ) :
                        ℝ) -
                      (a * (((1 : ℝ) - (√((1 : ℝ) - (a ^ (2 : ℕ) : ℝ) : ℝ) : ℝ) : ℝ) / a : ℝ) : ℝ) :
                    ℝ) ∨
                b >
                  ((Real.log
                          ((1 : ℝ) +
                              ((((1 : ℝ) + (√((1 : ℝ) - (a ^ (2 : ℕ) : ℝ) : ℝ) : ℝ) : ℝ) / a : ℝ) ^ (2 : ℕ) : ℝ) :
                            ℝ) :
                        ℝ) -
                      (a * (((1 : ℝ) + (√((1 : ℝ) - (a ^ (2 : ℕ) : ℝ) : ℝ) : ℝ) : ℝ) / a : ℝ) : ℝ) :
                    ℝ))} :
    Set (ℝ × ℝ))
Problem: Let $n$ be an integer with $n \geq 2$. Over all real polynomials $p(x)$ of degree $n$, what is the largest possible number of negative coefficients of $p(x)^2$?

Answer: $2n - 2$

Lean 4 formalization:
open Polynomial
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 2
name: hn
t: Set ℝ[X]
name: S
t: S = {P | natDegree P = n}
name: hS
t: ℝ[X] → ℕ
name: negs
t: ∀ P : ℝ[X], negs P = ∑ i in Finset.range (P.natDegree + 1), if P.coeff i < 0 then 1 else 0
name: hnegs
Conclusion:
(sSup {negs (P^2) | P ∈ S} = answer n)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => (((2 : ℕ) * n : ℕ) - (2 : ℕ) : ℕ)
Problem: Alice and Bob play a game on a board consisting of one row of 2022 consecutive squares. They take turns placing tiles that cover two adjacent squares, with Alice going first. By rule, a tile must not cover a square that is already covered by another tile. The game ends when no tile can be placed according to this rule. Alice's goal is to maximize the number of uncovered squares when the game ends; Bob's goal is to minimize it. What is the greatest number of uncovered squares that Alice can ensure at the end of the game, no matter how Bob plays?

Answer: 290

Lean 4 formalization:
Independent variables:
Hypotheses:
t: Set (Fin 2022) → Set (Fin 2022) → Prop
name: IsValidMove
t: ∀ x y, IsValidMove x y ↔
      (x = y ∧ ∀ i < 2021, i ∉ x → i + 1 ∈ x) ∨
      ∃ i < 2021, i ∉ x ∧ i + 1 ∉ x ∧ y = x ∪ {i, i + 1}
name: IsValidMove_def
t: List (Set (Fin 2022)) → Prop
name: IsValidGame
t: ∀ g, IsValidGame g ↔ (∃ gt, g = ∅ :: gt) ∧ g.Chain' IsValidMove
name: IsValidGame_def
t: List (Set (Fin 2022)) → (Set (Fin 2022) → Set (Fin 2022)) → Prop
name: ConformsToStrategy
t: ∀ g s, ConformsToStrategy g s ↔
      ∀ (i) (h : i + 1 < g.length), Even i → g[i + 1] = s g[i]
name: ConformsToStrategy_def
Conclusion:
(IsGreatest
      {n | ∃ s, (∀ x, IsValidMove x (s x)) ∧ ∀ g,
        IsValidGame g → ConformsToStrategy g s → ∃ gh x, g = gh ++ [x] ∧ n ≤ xᶜ.ncard}
      answer)
Formal answer (type: ℕ):
answer = (290 : ℕ)
Problem: Let $n$ be a positive integer. Determine, in terms of $n$, the largest integer $m$ with the following property: There exist real numbers $x_1,\dots,x_{2n}$ with $-1<x_1<x_2<\cdots<x_{2n}<1$ such that the sum of the lengths of the $n$ intervals $[x_1^{2k-1},x_2^{2k-1}],[x_3^{2k-1},x_4^{2k-1}],\dots,[x_{2n-1}^{2k-1},x_{2n}^{2k-1}]$ is equal to $1$ for all integers $k$ with $1 \leq k \leq m$.

Answer: (fun n : ℕ => n)

Lean 4 formalization:
open Set
Independent variables:
t: ℕ
name: n
Hypotheses:
t: 0 < n
name: hn
Conclusion:
(IsGreatest
      {m : ℕ | ∃ x : ℕ → ℝ,
        StrictMono x ∧ -1 < x 1 ∧ x (2 * n) < 1 ∧
        ∀ k ∈ Icc 1 m, ∑ i in Icc 1 n, ((x (2 * i) : ℝ) ^ (2 * k - 1) - (x (2 * i - 1)) ^ (2 * k - 1)) = 1}
    (answer n))
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => n
Problem: Let $\times$ represent the cross product in $\mathbb{R}^3$. For what positive integers $n$ does there exist a set $S \subset \mathbb{R}^3$ with exactly $n$ elements such that $S=\{v \times w:v,w \in S\}$?

Answer: {1, 7}

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
t: ℕ
name: n
t: Finset (Fin 3 → ℝ) → Prop
name: P
t: ∀ S : Finset (Fin 3 → ℝ), P S ↔ (S = {u : Fin 3 → ℝ | ∃ v w : S, u = crossProduct v w})
name: P_def
Conclusion:
((0 < n ∧ ∃ S : Finset (Fin 3 → ℝ), S.card = n ∧ P S) ↔ n ∈ answer)
Formal answer (type: Set ℕ):
answer = (Insert.insert (1 : ℕ) ({(7 : ℕ)} : Set ℕ) : Set ℕ)
Problem: Assign to each positive real number a color, either red or blue. Let $D$ be the set of all distances $d>0$ such that there are two points of the same color at distance $d$ apart. Recolor the positive reals so that the numbers in $D$ are red and the numbers not in $D$ are blue. If we iterate this recoloring process, will we always end up with all the numbers red after a finite number of steps?

Answer: True

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
t: (ℝ → Prop) → (ℝ → Prop)
name: recolor
t: ∀ isred d, recolor isred d ↔ ∃ p q : ℝ, p > 0 ∧ q > 0 ∧ p < q ∧ isred p = isred q ∧ q - p = d
name: hrecolor
Conclusion:
((∀ isred, (∃ k, ∀ p > 0, (recolor^[k] isred) p)) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Find all integers $n$ with $n \geq 4$ for which there exists a sequence of distinct real numbers $x_1,\dots,x_n$ such that each of the sets $\{x_1,x_2,x_3\},\{x_2,x_3,x_4\},\dots,\{x_{n-2},x_{n-1},x_n\},\{x_{n-1},x_n,x_1\}$, and $\{x_n,x_1,x_2\}$ forms a $3$-term arithmetic progression when arranged in increasing order.

Answer: {n : ℕ | 3 ∣ n ∧ n ≥ 9}

Lean 4 formalization:
open Polynomial
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 4
name: hn
t: ℝ → ℝ → ℝ → Prop
name: ap3
t: (ℕ → ℝ) → Prop
name: xprog
t: ∀ x0 x1 x2, ap3 x0 x1 x2 ↔ ∀ o0 o1 o2 : ℝ, (o0 < o1 ∧ o1 < o2 ∧ ({o0, o1, o2} : Set ℝ) = {x0, x1, x2}) → (o1 - o0 = o2 - o1)
name: hap3
t: ∀ x, xprog x ↔
    ((∀ i j : Fin n, i.1 ≠ j.1 → x i.1 ≠ x j.1) ∧ (∀ i : Fin n, ap3 (x i.1) (x ((i.1 + 1) % n)) (x ((i.1 + 2) % n))))
name: hxprog
Conclusion:
((∃ x, xprog x) ↔ n ∈ answer)
Formal answer (type: Set ℕ):
answer = ({n : ℕ | (3 : ℕ) ∣ n ∧ n ≥ (9 : ℕ)} : Set ℕ)
Problem: For $0 \leq p \leq 1/2$, let $X_1,X_2,\dots$ be independent random variables such that
$X_i=\begin{cases}
1 & \text{with probability $p$,} \\
-1 & \text{with probability $p$,} \\
0 & \text{with probability $1-2p$,}
\end{cases}$
for all $i \geq 1$. Given a positive integer $n$ and integers $b,a_1,\dots,a_n$, let $P(b,a_1,\dots,a_n)$ denote the probability that $a_1X_1+\dots+a_nX_n=b$. For which values of $p$ is it the case that $P(0,a_1,\dots,a_n) \geq P(b,a_1,\dots,a_n)$ for all positive integers $n$ and all integers $b,a_1,\dots,a_n$?

Answer: Set.Icc 0 (1 / 4)

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
t: ℝ
name: p
t: (n : ℕ) → Set (Fin n → ℤ)
name: Xset
t: (n : ℕ) → (Fin n → ℤ) → ℝ
name: Xprob
t: (n : ℕ) → ℤ → (Fin n → ℤ) → ℝ
name: P
t: ∀ n > 0, Xset n = {X : Fin n → ℤ | ∀ i : Fin n, X i = 1 ∨ X i = -1 ∨ X i = 0}
name: hXset
t: ∀ n > 0, ∀ X : Fin n → ℤ, Xprob n X = ∏ i : Fin n, if (X i = 1 ∨ X i = -1) then p else (1 - 2 * p)
name: hXprob
t: ∀ n > 0, ∀ (b : ℤ) (a : Fin n → ℤ), P n b a = ∑' X : {X' ∈ Xset n | (∑ i : Fin n, a i * X' i) = b}, Xprob n X
name: hP
Conclusion:
((0 ≤ p ∧ p ≤ 1 / 2 ∧ (∀ n > 0, ∀ (b : ℤ) (a : Fin n → ℤ), P n 0 a ≥ P n b a)) ↔ p ∈ answer)
Formal answer (type: Set ℝ):
answer = (Set.Icc (0 : ℝ) (1 / 4 : ℝ) : Set ℝ)
Problem: Find all continuous functions $f:\mathbb{R}^+ \to \mathbb{R}^+$ such that $f(xf(y))+f(yf(x))=1+f(x+y)$ for all $x,y>0$.

Answer: the set of functions of the form f(x) = 1 / (1 + c * x) where c ≥ 0

Lean 4 formalization:
open Polynomial
Independent variables:
t: Set.Ioi (0 : ℝ) → Set.Ioi (0 : ℝ)
name: f
Hypotheses:
t: Continuous f
name: hf
Conclusion:
((∃ fr : ℝ → ℝ, (∀ x : Set.Ioi (0 : ℝ), fr x = f x) ∧ (∀ x y : Set.Ioi (0 : ℝ), fr (x * fr y) + fr (y * fr x) = 1 + fr (x + y))) ↔ f ∈ answer)
Formal answer (type: Set (Set.Ioi (0 : ℝ) → Set.Ioi (0 : ℝ))):
answer =
  ({f : ↑(Set.Ioi (0 : ℝ) : Set ℝ) → ↑(Set.Ioi (0 : ℝ) : Set ℝ) |
      ∃ c ≥ (0 : ℝ),
        ∀ (x : ↑(Set.Ioi (0 : ℝ) : Set ℝ)),
          (↑(f x : ↑(Set.Ioi (0 : ℝ) : Set ℝ)) : ℝ) = ((1 : ℝ) / ((1 : ℝ) + (c * (↑x : ℝ) : ℝ) : ℝ) : ℝ)} :
    Set (↑(Set.Ioi (0 : ℝ) : Set ℝ) → ↑(Set.Ioi (0 : ℝ) : Set ℝ)))
Problem: For a positive integer $n$, let $f_n(x) = \cos(x) \cos(2x) \cos(3x) \cdots \cos(nx)$. Find the smallest $n$ such that $|f_n''(0)| > 2023$.

Answer: 18

Lean 4 formalization:
open Nat
Independent variables:
Hypotheses:
t: ℕ → ℝ → ℝ
name: f
t: ∀ n > 0, f n = fun x : ℝ => ∏ i in Finset.Icc 1 n, Real.cos (i * x)
name: hf
Conclusion:
(IsLeast {n | 0 < n ∧ |iteratedDeriv 2 (f n) 0| > 2023} answer)
Formal answer (type: ℕ):
answer = (18 : ℕ)
Problem: Let $n$ be an even positive integer. Let $p$ be a monic, real polynomial of degree $2n$; that is to say, $p(x) = x^{2n} + a_{2n-1} x^{2n-1} + \cdots + a_1 x + a_0$ for some real coefficients $a_0, \dots, a_{2n-1}$. Suppose that $p(1/k) = k^2$ for all integers $k$ such that $1 \leq |k| \leq n$. Find all other real numbers $x$ for which $p(1/x) = x^2$.

Answer: {1/n!, -1/n!}

Lean 4 formalization:
open Nat
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n > 0 ∧ Even n
name: hn
t: Polynomial ℝ
name: p
t: Polynomial.Monic p ∧ p.degree = 2*n
name: hp
t: Set ℝ
name: S
t: S = {x : ℝ | ∃ k : ℤ, x = k ∧ 1 ≤ |k| ∧ |k| ≤ n}
name: hS
t: ∀ k ∈ S, p.eval (1/k) = k^2
name: hpinv
Conclusion:
({x : ℝ | x ≠ 0 ∧ p.eval (1/x) = x^2} \ S = answer n)
Formal answer (type: ℕ → Set ℝ):
answer = fun (n : ℕ) =>
  (Insert.insert ((1 : ℝ) / (↑(n ! : ℕ) : ℝ) : ℝ) ({((-1 : ℝ) / (↑(n ! : ℕ) : ℝ) : ℝ)} : Set ℝ) : Set ℝ)
Problem: Determine the smallest positive real number $r$ such that there exist differentiable functions $f\colon \mathbb{R} \to \mathbb{R}$ and $g\colon \mathbb{R} \to \mathbb{R}$ satisfying
\begin{enumerate}
 \item[(a)] $f(0) > 0$,
 \item[(b)] $g(0) = 0$,
 \item[(c)] $|f'(x)| \leq |g(x)|$ for all $x$,
 \item[(d)] $|g'(x)| \leq |f(x)|$ for all $x$, and
 \item[(e)] $f(r) = 0$. \end{enumerate}

Answer: π/2

Lean 4 formalization:
open Nat
Independent variables:
Hypotheses:
Conclusion:
(answer = sInf {r > 0 | ∃ f g : ℝ → ℝ,
    Differentiable ℝ f ∧ Differentiable ℝ g ∧
    (∀ x : ℝ, |deriv f x| ≤ |g x| ∧ |deriv g x| ≤ |f x|) ∧
    f 0 > 0 ∧ g 0 = 0 ∧ f r = 0})
Formal answer (type: ℝ):
answer = ((Real.pi : ℝ) / (2 : ℝ) : ℝ)
Problem: For a nonnegative integer $k$, let $f(k)$ be the number of ones in the base 3 representation of $k$. Find all complex numbers $z$ such that \[ \sum_{k=0}^{3^{1010}-1} (-2)^{f(k)} (z+k)^{2023} = 0. \]

Answer: {-(3^1010 - 1)/2, -(3^1010 - 1)/2 + Real.sqrt (9^1010 - 1) * Complex.I/4, -(3^1010 - 1)/2 - Real.sqrt (9^1010 - 1) * Complex.I/4}

Lean 4 formalization:
open Nat
Independent variables:
Hypotheses:
Conclusion:
({z : ℂ | ∑ k in Finset.Icc 0 (3^1010 - 1),
   (-2)^(((digits 3 k).filter (fun x => x = 1)).length) * (z + k)^2023 = 0} = answer)
Formal answer (type: Set ℂ):
answer =
  (Insert.insert ((-(((3 : ℂ) ^ (1010 : ℕ) : ℂ) - (1 : ℂ) : ℂ) : ℂ) / (2 : ℂ) : ℂ)
      (Insert.insert
          (((-(((3 : ℂ) ^ (1010 : ℕ) : ℂ) - (1 : ℂ) : ℂ) : ℂ) / (2 : ℂ) : ℂ) +
              (((↑(√(((9 : ℝ) ^ (1010 : ℕ) : ℝ) - (1 : ℝ) : ℝ) : ℝ) : ℂ) * (Complex.I : ℂ) : ℂ) / (4 : ℂ) : ℂ) :
            ℂ)
          ({(((-(((3 : ℂ) ^ (1010 : ℕ) : ℂ) - (1 : ℂ) : ℂ) : ℂ) / (2 : ℂ) : ℂ) -
                  (((↑(√(((9 : ℝ) ^ (1010 : ℕ) : ℝ) - (1 : ℝ) : ℝ) : ℝ) : ℂ) * (Complex.I : ℂ) : ℂ) / (4 : ℂ) : ℂ) :
                ℂ)} :
            Set ℂ) :
        Set ℂ) :
    Set ℂ)