purewhite42/formal_problem_solving_main huggingface dataset:
Problem: Let $E(n)$ be the greatest integer $k$ such that $5^k$ divides $1^1 2^2 3^3 \cdots n^n$. Find $\lim_{n \rightarrow \infty} \frac{E(n)}{n^2}$.

Answer: $\frac{1}{8}$

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: ℕ → ℕ → Prop
name: P
t: ∀ n k, P n k ↔ 5^k ∣ ∏ m in Finset.Icc 1 n, (m^m : ℤ)
name: hP
t: ℕ → ℕ
name: E
t: ∀ n ∈ Ici 1, P n (E n) ∧ ∀ k : ℕ, P n k → k ≤ E n
name: hE
Conclusions: (Tendsto (fun n : ℕ => ((E n) : ℝ)/n^2) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (1 / 8 : ℝ)
Problem: Does the limit $$lim_{t \rightarrow \infty}e^{-t}\int_{0}^{t}\int_{0}^{t}\frac{e^x - e^y}{x - y} dx dy$$exist?

Answer: False

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: ℝ → ℝ
name: f
t: f = fun t : ℝ => Real.exp (-t) * ∫ y in (Ico 0 t), ∫ x in (Ico 0 t), (Real.exp x - Real.exp y) / (x - y)
name: hf
Conclusions: ((∃ L : ℝ, Tendsto f atTop (𝓝 L)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Let $P(x)$ be a polynomial with real coefficients; let $$Q(x) = (x^2 + 1)P(x)P'(x) + x((P(x))^2 + (P'(x))^2).$$
Given that $P$ has $n$ distinct real roots all greater than $1$, prove or disprove that $Q$ must have at least $2n - 1$ distinct real roots.

Answer: True

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: Polynomial ℝ → Polynomial ℝ
name: Q
t: Q = fun P : Polynomial ℝ => (Polynomial.X^2 + 1) * P * (Polynomial.derivative P) + Polynomial.X * (P^2 + (Polynomial.derivative P)^2)
name: hQ
t: Polynomial ℝ → ℝ
name: n
t: n = fun P : Polynomial ℝ => ({x ∈ Ioi 1 | P.eval x = 0}.ncard : ℝ)
name: hn
Conclusions: (answer ↔ (∀ P : Polynomial ℝ, {x : ℝ | (Q P).eval x = 0}.ncard ≥ 2*(n P) - 1))
Answer type: Prop
Formal answer: answer = True
Problem: Find the value of $$\lim_{n \rightarrow \infty} \frac{1}{n^5}\sum_{h=1}^{n}\sum_{k=1}^{n}(5h^4 - 18h^2k^2 + 5k^4).$$

Answer: -1

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: ℕ → ℝ
name: f
t: f = fun n : ℕ => ((1 : ℝ)/n^5) * ∑ h in Finset.Icc 1 n, ∑ k in Finset.Icc 1 n, (5*(h : ℝ)^4 - 18*h^2*k^2 + 5*k^4)
name: hf
Conclusions: (Tendsto f atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (-1 : ℝ)
Problem: Determine the minimum value attained by $$(r - 1)^2 + (\frac{s}{r} - 1)^2 + (\frac{t}{s} - 1)^2 + (\frac{4}{t} - 1)^2$$ across all choices of real $r$, $s$, and $t$ that satisfy $1 \le r \le s \le t \le 4$.

Answer: 12 - 8 * Real.sqrt 2

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: ℝ × ℝ × ℝ → Prop
name: P
t: P = fun (r, s, t) => 1 ≤ r ∧ r ≤ s ∧ s ≤ t ∧ t ≤ 4
name: hP
t: ℝ × ℝ × ℝ → ℝ
name: f
t: f = fun (r, s, t) => (r - 1)^2 + (s/r - 1)^2 + (t/s - 1)^2 + (4/t - 1)^2
name: hf
Conclusions: (IsLeast {y | ∃ r s t, P (r, s, t) ∧ f (r, s, t) = y} answer)
Answer type: ℝ
Formal answer: answer = ((12 : ℝ) - ((8 : ℝ) * (√(2 : ℝ) : ℝ) : ℝ) : ℝ)
Problem: Let $V$ be a set of $5$ by $7$ matrices, with real entries and with the property that $rA+sB \in V$ whenever $A,B \in V$ and $r$ and $s$ are scalars (i.e., real numbers). \emph{Prove or disprove} the following assertion: If $V$ contains matrices of ranks $0$, $1$, $2$, $4$, and $5$, then it also contains a matrix of rank $3$. [The rank of a nonzero matrix $M$ is the largest $k$ such that the entries of some $k$ rows and some $k$ columns form a $k$ by $k$ matrix with a nonzero determinant.]

Answer: False

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: Set (Matrix (Fin 5) (Fin 7) ℝ) → Prop
name: VAB
t: Set (Matrix (Fin 5) (Fin 7) ℝ) → ℕ → Prop
name: Vrank
t: ∀ V, VAB V = (∀ A ∈ V, ∀ B ∈ V, ∀ r s : ℝ, r • A + s • B ∈ V)
name: hVAB
t: ∀ V k, Vrank V k = ∃ A ∈ V, A.rank = k
name: hVrank
Conclusions: (answer ↔
    (∀ V,
      VAB V → Vrank V 0 → Vrank V 1 →
      Vrank V 2 → Vrank V 4 → Vrank V 5 →
    Vrank V 3))
Answer type: Prop
Formal answer: answer = False
Problem: Let $B(n)$ be the number of ones in the base two expression for the positive integer $n$. For example, $B(6)=B(110_2)=2$ and $B(15)=B(1111_2)=4$. Determine whether or not $\exp \left(\sum_{n=1}^\infty \frac{B(n)}{n(n+1)}\right)$ is a rational number. Here $\exp(x)$ denotes $e^x$.

Answer: True

Lean 4 formalization:
open Topology Filter Set Polynomial Function
Hypotheses: t: List ℕ → ℤ
name: sumbits
t: ℕ → ℤ
name: B
t: ∀ bits : List ℕ, sumbits bits = ∑ i : Fin bits.length, (bits[i] : ℤ)
name: hsumbits
t: ∀ n > 0, B n = sumbits (Nat.digits 2 n)
name: hB
Conclusions: (answer ↔ (∃ q : ℚ, Real.exp (∑' n : Set.Ici 1, B n / ((n : ℝ) * ((n : ℝ) + 1))) = q))
Answer type: Prop
Formal answer: answer = True
Problem: Let $B_n(x) = 1^x + 2^x + \dots + n^x$ and let $f(n) = \frac{B_n(\log_n 2)}{(n \log_2 n)^2}$. Does $f(2) + f(3) + f(4) + \dots$ converge?

Answer: True

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Hypotheses: t: ℕ → ℝ → ℝ
name: B
t: B = fun (n : ℕ) (x : ℝ) ↦ ∑ k in Finset.Icc 1 n, (k : ℝ) ^ x
name: hB
t: ℕ → ℝ
name: f
t: f = fun n ↦ B n (logb n 2) / (n * logb 2 n) ^ 2
name: hf
Conclusions: (answer ↔ (∃ L : ℝ, Tendsto (fun N ↦ ∑ j in Finset.Icc 2 N, f j) atTop (𝓝 L)))
Answer type: Prop
Formal answer: answer = True
Problem: Evaluate $\int_0^{\infty} \frac{\tan^{-1}(\pi x) - \tan^{-1} x}{x} \, dx$.

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

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Conclusions: (Tendsto (fun t ↦ ∫ x in (0)..t, (arctan (Real.pi * x) - arctan x) / x) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (((π : ℝ) / (2 : ℝ) : ℝ) * (Real.log (π : ℝ) : ℝ) : ℝ)
Problem: Let $b$ be a bijection from the positive integers to the positive integers. Also, let $x_1, x_2, x_3, \dots$ be an infinite sequence of real numbers with the following properties:
\begin{enumerate}
\item
$|x_n|$ is a strictly decreasing function of $n$;
\item
$\lim_{n \rightarrow \infty} |b(n) - n| \cdot |x_n| = 0$;
\item
$\lim_{n \rightarrow \infty}\sum_{k = 1}^{n} x_k = 1$.
\end{enumerate}
Prove or disprove: these conditions imply that $$\lim_{n \rightarrow \infty} \sum_{k = 1}^{n} x_{b(k)} = 1.$$

Answer: False

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Hypotheses: t: ℕ → ℕ
name: b
t: ℕ → ℝ
name: x
t: BijOn b (Ici 1) (Ici 1)
name: h_bij
t: StrictAntiOn (fun n : ℕ => |x n|) (Ici 1)
name: h_strict_anti
t: Tendsto (fun n : ℕ => |b n - (n : ℤ)| * |x n|) atTop (𝓝 0)
name: h_limit
t: Tendsto (fun n : ℕ => ∑ k in Finset.Icc 1 n, x k) atTop (𝓝 1)
name: h_sum_limit
Conclusions: ((Tendsto (fun n : ℕ => ∑ k in Finset.Icc 1 n, x (b k)) atTop (𝓝 1)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Let $A(x, y)$ denote the number of points $(m, n)$ with integer coordinates $m$ and $n$ where $m^2 + n^2 \le x^2 + y^2$. Also, let $g = \sum_{k = 0}^{\infty} e^{-k^2}$. Express the value $$\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} A(x, y)e^{-x^2 - y^2} dx dy$$ as a polynomial in $g$.

Answer: C Real.pi * (2*X - 1)^2

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Hypotheses: t: ℝ × ℝ → ℕ
name: A
t: ℝ
name: g
t: ℝ
name: I
t: A = fun (x, y) => {a : ℤ × ℤ | a.1^2 + a.2^2 ≤ x^2 + y^2}.ncard
name: hA
t: g = ∑' k : ℕ, Real.exp (-k^2)
name: hg
t: I = ∫ y : ℝ, ∫ x : ℝ, A (x, y) * Real.exp (-x^2 - y^2)
name: hI
Conclusions: (I = answer.eval g)
Answer type: Polynomial ℝ
Formal answer: answer =
  ((((Polynomial.C : ℝ →+* ℝ[X]) : ℝ → ℝ[X]) (π : ℝ) : ℝ[X]) *
      ((((2 : ℝ[X]) * (Polynomial.X : ℝ[X]) : ℝ[X]) - (1 : ℝ[X]) : ℝ[X]) ^ (2 : ℕ) : ℝ[X]) :
    ℝ[X])
Problem: Let $p_n$ denote the probability that $c + d$ will be a perfect square if $c$ and $d$ are selected independently and uniformly at random from $\{1, 2, 3, \dots, n\}$. Express $\lim_{n \rightarrow \infty} p_n \sqrt{n}$ in the form $r(\sqrt{s} - t)$ for integers $s$ and $t$ and rational $r$.

Answer: 4/3 * (Real.sqrt 2 - 1)

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Hypotheses: t: ℕ → ℝ
name: p
t: p = fun n : ℕ => ({c : Finset.Icc 1 n × Finset.Icc 1 n | ∃ m : ℕ, m^2 = c.1 + c.2}.ncard : ℝ) / n^2
name: hp
Conclusions: (Tendsto (fun n : ℕ => p n * Real.sqrt n) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = ((4 / 3 : ℝ) * ((√(2 : ℝ) : ℝ) - (1 : ℝ) : ℝ) : ℝ)
Problem: Let $n_1, n_2, \dots, n_s$ be distinct integers such that, for every integer $k$, $n_1n_2\cdots n_s$ divides $(n_1 + k)(n_2 + k) \cdots (n_s + k)$. Prove or provide a counterexample to the following claims:
\begin{enumerate}
\item
For some $i$, $|n_i| = 1$.
\item
If all $n_i$ are positive, then $\{n_1, n_2, \dots, n_s\} = \{1, 2, \dots, s\}$.
\end{enumerate}

Answer: (True, True)

Lean 4 formalization:
open Set Function Filter Topology Polynomial Real
Hypotheses: t: Finset ℤ → Prop
name: P
t: ∀ n, P n ↔ n.Nonempty ∧ ∀ k, ∏ i in n, i ∣ ∏ i in n, (i + k)
name: P_def
Conclusions: (((∀ n, P n → 1 ∈ n ∨ -1 ∈ n) ↔ answer.1) ∧
    ((∀ n, P n → (∀ i ∈ n, 0 < i) → n = Finset.Icc (1 : ℤ) n.card) ↔ answer.2))
Answer type: Prop × Prop
Formal answer: answer = ((True, True) : Prop × Prop)
Problem: How many positive integers $n$ are there such that $n$ is an exact divisor of at least one of the numbers $10^{40},20^{30}$?

Answer: 2301

Lean 4 formalization:
Conclusions: ({n : ℤ | n > 0 ∧ (n ∣ 10 ^ 40 ∨ n ∣ 20 ^ 30)}.encard = answer)
Answer type: ℕ
Formal answer: answer = (2301 : ℕ)
Problem: Prove or disprove that there exists a positive real number $\alpha$ such that $[\alpha_n] - n$ is even for all integers $n > 0$. (Here $[x]$ denotes the greatest integer less than or equal to $x$.)

Answer: True

Lean 4 formalization:
open Nat
Conclusions: (answer ↔ (∃ α : ℝ, α > 0 ∧ ∀ n : ℕ, n > 0 → Even (⌊α ^ n⌋ - n)))
Answer type: Prop
Formal answer: answer = True
Problem: Let $T$ be the triangle with vertices $(0, 0)$, $(a, 0)$, and $(0, a)$. Find $\lim_{a \to \infty} a^4 \exp(-a^3) \int_T \exp(x^3+y^3) \, dx \, dy$.

Answer: 2 / 9

Lean 4 formalization:
open Nat Filter Topology Real
Hypotheses: t: ℝ → ℝ
name: F
t: F = fun a ↦ (a ^ 4 / exp (a ^ 3)) * ∫ x in (0)..a, ∫ y in (0)..(a - x), exp (x ^ 3 + y ^ 3)
name: hF
Conclusions: (Tendsto F atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (2 / 9 : ℝ)
Problem: Let $f(n)$ be the number of ways of representing $n$ as a sum of powers of $2$ with no power being used more than $3$ times. For example, $f(7) = 4$ (the representations are $4 + 2 + 1$, $4 + 1 + 1 + 1$, $2 + 2 + 2 + 1$, $2 + 2 + 1 + 1 + 1$). Can we find a real polynomial $p(x)$ such that $f(n) = [p(n)]$, where $[u]$ denotes the greatest integer less than or equal to $u$?

Answer: True

Lean 4 formalization:
open Nat Filter Topology Real
Hypotheses: t: ℕ+ → ℕ
name: f
t: f = fun (n : ℕ+) ↦
      Set.ncard {M : Multiset ℕ |
        (∀ m ∈ M, ∃ k : ℕ, m = (2 ^ k : ℤ)) ∧
        (∀ m ∈ M, M.count m ≤ 3) ∧
        (M.sum : ℤ) = n}
name: hf
Conclusions: (answer ↔ (∃ p : Polynomial ℝ, ∀ n : ℕ+, ⌊p.eval (n : ℝ)⌋ = f n))
Answer type: Prop
Formal answer: answer = True
Problem: Define $\left\lVert x \right\rVert$ as the distance from $x$ to the nearest integer. Find $\lim_{n \to \infty} \frac{1}{n} \int_{1}^{n} \left\lVert \frac{n}{x} \right\rVert \, dx$. You may assume that $\prod_{n=1}^{\infty} \frac{2n}{(2n-1)} \cdot \frac{2n}{(2n+1)} = \frac{\pi}{2}$.

Answer: $\log \left(\frac{4}{\pi}\right)$

Lean 4 formalization:
open Nat Filter Topology Real
Hypotheses: t: ℝ → ℝ
name: dist_fun
t: dist_fun = fun (x : ℝ) ↦ min (x - ⌊x⌋) (⌈x⌉ - x)
name: hdist_fun
t: Tendsto (fun N ↦ ∏ n in Finset.Icc 1 N, (2 * n / (2 * n - 1)) * (2 * n / (2 * n + 1)) : ℕ → ℝ) atTop (𝓝 (Real.pi / 2))
name: fact
Conclusions: (Tendsto (fun n ↦ (1 / n) * ∫ x in (1)..n, dist_fun (n / x) : ℕ → ℝ) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (Real.log ((4 : ℝ) / (π : ℝ) : ℝ) : ℝ)
Problem: Express $\sum_{k=1}^\infty (6^k/(3^{k+1}-2^{k+1})(3^k-2^k))$ as a rational number.

Answer: 2

Lean 4 formalization:
Conclusions: (∑' k : Set.Ici 1, (6 ^ (k : ℕ) / ((3 ^ ((k : ℕ) + 1) - 2 ^ ((k : ℕ) + 1)) * (3 ^ (k : ℕ) - 2 ^ (k : ℕ)))) = answer)
Answer type: ℚ
Formal answer: answer = (2 : ℚ)
Problem: Let $n$ be a positive integer. Let $a,b,x$ be real numbers, with $a \neq b$, and let $M_n$ denote the $2n \times 2n$ matrix whose $(i,j)$ entry $m_{ij}$ is given by
\[
m_{ij}=\begin{cases}
x & \text{if }i=j, \\
a & \text{if }i \neq j\text{ and }i+j\text{ is even}, \\
b & \text{if }i \neq j\text{ and }i+j\text{ is odd}.
\end{cases}
\]
Thus, for example, $M_2=\begin{pmatrix} x & b & a & b \\ b & x & b & a \\ a & b & x & b \\ b & a & b & x \end{pmatrix}$. Express $\lim_{x \to a} \det M_n/(x-a)^{2n-2}$ as a polynomial in $a$, $b$, and $n$, where $\det M_n$ denotes the determinant of $M_n$.

Answer: $(X_2)^2 \cdot ((X_0)^2 - (X_1)^2)$

Lean 4 formalization:
open Topology Filter
Hypotheses: t: ℕ
name: n
t: ℝ
name: a
t: ℝ
name: b
t: ℝ → Matrix (Fin (2 * n)) (Fin (2 * n)) ℝ
name: Mn
t: Fin 3 → ℝ
name: polyabn
t: n > 0
name: npos
t: a ≠ b
name: aneb
t: Mn = fun x : ℝ => fun i j : Fin (2 * n) => if i = j then x else if Even (i.1 + j.1) then a else b
name: hMn
t: polyabn 0 = a ∧ polyabn 1 = b ∧ polyabn 2 = n
name: hpolyabn
Conclusions: (Tendsto (fun x : ℝ => (Mn x).det / (x - a) ^ (2 * n - 2)) (𝓝[≠] a) (𝓝 (MvPolynomial.eval polyabn answer)))
Answer type: MvPolynomial (Fin 3) ℝ
Formal answer: answer =
  (((MvPolynomial.X (2 : Fin (3 : ℕ)) : MvPolynomial (Fin (3 : ℕ)) ℝ) ^ (2 : ℕ) : MvPolynomial (Fin (3 : ℕ)) ℝ) *
      (((MvPolynomial.X (0 : Fin (3 : ℕ)) : MvPolynomial (Fin (3 : ℕ)) ℝ) ^ (2 : ℕ) : MvPolynomial (Fin (3 : ℕ)) ℝ) -
          ((MvPolynomial.X (1 : Fin (3 : ℕ)) : MvPolynomial (Fin (3 : ℕ)) ℝ) ^ (2 : ℕ) : MvPolynomial (Fin (3 : ℕ)) ℝ) :
        MvPolynomial (Fin (3 : ℕ)) ℝ) :
    MvPolynomial (Fin (3 : ℕ)) ℝ)
Problem: Let $R$ be the region consisting of all triples $(x,y,z)$ of nonnegative real numbers satisfying $x+y+z \leq 1$. Let $w=1-x-y-z$. Express the value of the triple integral $\iiint_R x^1y^9z^8w^4\,dx\,dy\,dz$ in the form $a!b!c!d!/n!$, where $a$, $b$, $c$, $d$, and $n$ are positive integers.

Answer: (1, 9, 8, 4, 25)

Lean 4 formalization:
open Topology Filter Nat
Hypotheses: t: Set (Fin 3 → ℝ)
name: R
t: (Fin 3 → ℝ) → ℝ
name: w
t: R = {p | (∀ i : Fin 3, p i ≥ 0) ∧ p 0 + p 1 + p 2 ≤ 1}
name: hR
t: ∀ p, w p = 1 - p 0 - p 1 - p 2
name: hw
t: ℕ
name: a
t: ℕ
name: b
t: ℕ
name: c
t: ℕ
name: d
t: ℕ
name: n
t: a > 0 ∧ b > 0 ∧ c > 0 ∧ d > 0 ∧ n > 0
name: h_pos
t: (∫ p in R, (p 0) ^ 1 * (p 1) ^ 9 * (p 2) ^ 8 * (w p) ^ 4 = ((a)! * (b)! * (c)! * (d)! : ℝ) / (n)!)
name: h_integral
Conclusions: (answer = (a, b, c, d, n))
Answer type: ℕ × ℕ × ℕ × ℕ × ℕ
Formal answer: answer =
  (((1 : ℕ), (((9 : ℕ), (((8 : ℕ), (((4 : ℕ), (25 : ℕ)) : ℕ × ℕ)) : ℕ × ℕ × ℕ)) : ℕ × ℕ × ℕ × ℕ)) : ℕ × ℕ × ℕ × ℕ × ℕ)
Problem: Let $n$ be a positive integer, and let $f(n)$ denote the last nonzero digit in the decimal expansion of $n!$. For instance, $f(5)=2$.
\begin{enumerate}
\item[(a)] Show that if $a_1,a_2,\dots,a_k$ are \emph{distinct} nonnegative integers, then $f(5^{a_1}+5^{a_2}+\dots+5^{a_k})$ depends only on the sum $a_1+a_2+\dots+a_k$.
\item[(b)] Assuming part (a), we can define $g(s)=f(5^{a_1}+5^{a_2}+\dots+5^{a_k})$, where $s=a_1+a_2+\dots+a_k$. Find the least positive integer $p$ for which $g(s)=g(s + p)$, for all $s \geq 1$, or else show that no such $p$ exists.
\end{enumerate}

Answer: 4

Lean 4 formalization:
open Topology Filter Function Nat
Hypotheses: t: ℕ → ℕ
name: f
t: ∀ n, some (f n) = (Nat.digits 10 (n !)).find? (fun d ↦ d ≠ 0)
name: hf
t: ℕ → (ℕ → ℕ) → ℕ → Prop
name: IsPeriodicFrom
t: ∀ x f p, IsPeriodicFrom x f p ↔ Periodic (f ∘ (· + x)) p
name: IsPeriodicFrom_def
t: ℕ → (ℕ → ℕ) → ℕ → Prop
name: P
t: ∀ x g p, P x g p ↔ if p = 0 then (∀ q > 0, ¬ IsPeriodicFrom x g q) else
        IsLeast {q | 0 < q ∧ IsPeriodicFrom x g q} p
name: P_def
Conclusions: (∃ g : ℕ → ℕ,
      (∀ᵉ (k > 0) (a : Fin k → ℕ) (ha : Injective a), f (∑ i, 5 ^ (a i)) = g (∑ i, a i)) ∧
      P 1 g answer)
Answer type: ℕ
Formal answer: answer = (4 : ℕ)
Problem: Let $n$ be a positive integer, and define $f(n)=1!+2!+\dots+n!$. Find polynomials $P(x)$ and $Q(x)$ such that $f(n+2)=P(n)f(n+1)+Q(n)f(n)$ for all $n \geq 1$.

Answer: $(x + 3, -x - 2)$

Lean 4 formalization:
open Topology Filter Nat
Hypotheses: t: ℕ → ℤ
name: f
t: ∀ n > 0, f n = ∑ i : Set.Icc 1 n, ((i)! : ℤ)
name: hf
Conclusions: (∀ n ≥ 1, f (n + 2) = (answer.1).eval (n : ℝ) * f (n + 1) + (answer.2).eval (n : ℝ) * f n)
Answer type: Polynomial ℝ × Polynomial ℝ
Formal answer: answer =
  ((((Polynomial.X : Polynomial ℝ) + (3 : Polynomial ℝ) : Polynomial ℝ),
      ((-(Polynomial.X : Polynomial ℝ) : Polynomial ℝ) - (2 : Polynomial ℝ) : Polynomial ℝ)) :
    Polynomial ℝ × Polynomial ℝ)
Problem: Find the minimum value of $(u-v)^2+(\sqrt{2-u^2}-\frac{9}{v})^2$ for $0<u<\sqrt{2}$ and $v>0$.

Answer: 8

Lean 4 formalization:
open Topology Filter Nat
Hypotheses: t: ℝ → ℝ → ℝ
name: f
t: ∀ u v : ℝ, f u v = (u - v) ^ 2 + (Real.sqrt (2 - u ^ 2) - 9 / v) ^ 2
name: hf
Conclusions: (IsLeast {y | ∃ᵉ (u : Set.Ioo 0 √2) (v > 0), f u v = y} answer)
Answer type: ℝ
Formal answer: answer = (8 : ℝ)
Problem: Prove or disprove the following statement: If $F$ is a finite set with two or more elements, then there exists a binary operation $*$ on F such that for all $x,y,z$ in $F$,
\begin{enumerate}
\item[(i)] $x*z=y*z$ implies $x=y$ (right cancellation holds), and
\item[(ii)] $x*(y*z) \neq (x*y)*z$ (\emph{no} case of associativity holds).
\end{enumerate}

Answer: True

Lean 4 formalization:
open Topology Filter Nat
Conclusions: ((∀ (F : Type*) (_ : Fintype F), Fintype.card F ≥ 2 → (∃ mul : F → F → F, ∀ x y z : F, (mul x z = mul y z → x = y) ∧ (mul x (mul y z) ≠ mul (mul x y) z))) ↔ answer)
Answer type: Prop
Formal answer: answer = True
Problem: For each nonnegative integer $k$, let $d(k)$ denote the number of $1$'s in the binary expansion of $k$ (for example, $d(0)=0$ and $d(5)=2$). Let $m$ be a positive integer. Express $\sum_{k=0}^{2^m-1} (-1)^{d(k)}k^m$ in the form $(-1)^ma^{f(m)}(g(m))!$, where $a$ is an integer and $f$ and $g$ are polynomials.

Answer: (2, (Polynomial.X * (Polynomial.X - 1)) / 2, Polynomial.X)

Lean 4 formalization:
open Topology Filter Nat
Hypotheses: t: ℕ
name: m
t: m > 0
name: mpos
t: ℕ → ℕ
name: d
t: List ℕ → ℕ
name: sumbits
t: ∀ bits : List ℕ, sumbits bits = ∑ i : Fin bits.length, bits[i]
name: hsumbits
t: ∀ k : ℕ, d k = sumbits (Nat.digits 2 k)
name: hd
Conclusions: (let (a, f, g) := answer;
    ∑ k : Set.Icc 0 (2 ^ m - 1), (-(1 : ℤ)) ^ (d k) * (k : ℕ) ^ m = (-1) ^ m * (a : ℝ) ^ (f.eval (m : ℝ)) * (g.eval m)!)
Answer type: ℤ × Polynomial ℝ × Polynomial ℕ
Formal answer: answer =
  (((2 : ℤ),
      (((((Polynomial.X : Polynomial ℝ) * ((Polynomial.X : Polynomial ℝ) - (1 : Polynomial ℝ) : Polynomial ℝ) :
                Polynomial ℝ) /
              (2 : Polynomial ℝ) :
            Polynomial ℝ),
          (Polynomial.X : Polynomial ℕ)) :
        Polynomial ℝ × Polynomial ℕ)) :
    ℤ × Polynomial ℝ × Polynomial ℕ)
Problem: Determine, with proof, the number of ordered triples $(A_1, A_2, A_3)$ of sets which have the property that
\begin{enumerate}
\item[(i)] $A_1 \cup A_2 \cup A_3 = \{1,2,3,4,5,6,7,8,9,10\}$, and
\item[(ii)] $A_1 \cap A_2 \cap A_3 = \emptyset$.
\end{enumerate}
Express your answer in the form $2^a 3^b 5^c 7^d$, where $a,b,c,d$ are nonnegative integers.

Answer: (10, 10, 0, 0)

Lean 4 formalization:
open Set
Conclusions: (let (a, b, c, d) := answer;
  {(A1, A2, A3) : Set ℤ × Set ℤ × Set ℤ | A1 ∪ A2 ∪ A3 = Icc 1 10 ∧ A1 ∩ A2 ∩ A3 = ∅}.ncard = 2 ^ a * 3 ^ b * 5 ^ c * 7 ^ d)
Answer type: ℕ × ℕ × ℕ × ℕ
Formal answer: answer = (((10 : ℕ), (((10 : ℕ), (((0 : ℕ), (0 : ℕ)) : ℕ × ℕ)) : ℕ × ℕ × ℕ)) : ℕ × ℕ × ℕ × ℕ)
Problem: Let $d$ be a real number. For each integer $m \geq 0$, define a sequence $\{a_m(j)\}$, $j=0,1,2,\dots$ by the condition
\begin{align*}
a_m(0) &= d/2^m, \\
a_m(j+1) &= (a_m(j))^2 + 2a_m(j), \qquad j \geq 0.
\end{align*}
Evaluate $\lim_{n \to \infty} a_n(n)$.

Answer: $e^d - 1$

Lean 4 formalization:
open Set Filter Topology Real
Independent variables: t: ℝ
name: d
Hypotheses: t: ℕ → ℕ → ℝ
name: a
t: ∀ m : ℕ, a m 0 = d / 2 ^ m
name: ha0
t: ∀ m : ℕ, ∀ j : ℕ, a m (j + 1) = (a m j) ^ 2 + 2 * a m j
name: ha
Conclusions: (Tendsto (fun n ↦ a n n) atTop (𝓝 (answer d)))
Answer type: ℝ → ℝ
Formal answer: answer = fun (d : ℝ) => ((rexp d : ℝ) - (1 : ℝ) : ℝ)
Problem: Define a sequence $\{a_i\}$ by $a_1=3$ and $a_{i+1}=3^{a_i}$ for $i \geq 1$. Which integers between $00$ and $99$ inclusive occur as the last two digits in the decimal expansion of infinitely many $a_i$?

Answer: {87}

Lean 4 formalization:
open Set Filter Topology Real
Hypotheses: t: ℕ → ℕ
name: a
t: a 1 = 3
name: ha1
t: ∀ i ≥ 1, a (i + 1) = 3 ^ a i
name: ha
Conclusions: ({k : Fin 100 | ∀ N : ℕ, ∃ i ≥ N, a i % 100 = k} = answer)
Answer type: Set (Fin 100)
Formal answer: answer = ({(87 : Fin (100 : ℕ))} : Set (Fin (100 : ℕ)))
Problem: Let $I_m = \int_0^{2\pi} \cos(x)\cos(2x)\cdots \cos(mx)\,dx$. For which integers $m$, $1 \leq m \leq 10$ is $I_m \neq 0$?

Answer: {3, 4, 7, 8}

Lean 4 formalization:
open Set Filter Topology Real
Hypotheses: t: ℕ → ℝ
name: I
t: I = fun (m : ℕ) ↦ ∫ x in (0)..(2 * Real.pi), ∏ k in Finset.Icc 1 m, cos (k * x)
name: hI
Conclusions: ({m ∈ Finset.Icc 1 10 | I m ≠ 0} = answer)
Answer type: Set ℕ
Formal answer: answer =
  (Insert.insert (3 : ℕ) (Insert.insert (4 : ℕ) (Insert.insert (7 : ℕ) ({(8 : ℕ)} : Set ℕ) : Set ℕ) : Set ℕ) : Set ℕ)
Problem: If $p(x)= a_0 + a_1 x + \cdots + a_m x^m$ is a polynomial with real coefficients $a_i$, then set
\[
\Gamma(p(x)) = a_0^2 + a_1^2 + \cdots + a_m^2.
\]
Let $F(x) = 3x^2+7x+2$. Find, with proof, a polynomial $g(x)$ with real coefficients such that
\begin{enumerate}
\item[(i)] $g(0)=1$, and
\item[(ii)] $\Gamma(f(x)^n) = \Gamma(g(x)^n)$
\end{enumerate}
for every integer $n \geq 1$.

Answer: 6x^2 + 5x + 1

Lean 4 formalization:
open Set Filter Topology Real Polynomial
Hypotheses: t: Polynomial ℝ → ℝ
name: Γ
t: Polynomial ℝ
name: f
t: Γ = fun p ↦ ∑ k in Finset.range (p.natDegree + 1), coeff p k ^ 2
name: hΓ
t: f = 3 * Polynomial.X ^ 2 + 7 * Polynomial.X + 2
name: hf
Conclusions: (let g := answer;
  g.eval 0 = 1 ∧ ∀ n : ℕ, n ≥ 1 → Γ (f ^ n) = Γ (g ^ n))
Answer type: Polynomial ℝ
Formal answer: answer =
  ((((6 : ℝ[X]) * ((Polynomial.X : ℝ[X]) ^ (2 : ℕ) : ℝ[X]) : ℝ[X]) + ((5 : ℝ[X]) * (Polynomial.X : ℝ[X]) : ℝ[X]) :
        ℝ[X]) +
      (1 : ℝ[X]) :
    ℝ[X])
Problem: Let $k$ be the smallest positive integer for which there exist distinct integers $m_1, m_2, m_3, m_4, m_5$ such that the polynomial
\[
p(x) = (x-m_1)(x-m_2)(x-m_3)(x-m_4)(x-m_5)
\]
has exactly $k$ nonzero coefficients. Find, with proof, a set of integers $m_1, m_2, m_3, m_4, m_5$ for which this minimum $k$ is achieved.

Answer: fun i : Fin 5 ↦ ↑i - (2 : ℤ)

Lean 4 formalization:
open Set Filter Topology Real Polynomial Function
Hypotheses: t: (Fin 5 → ℤ) → (Polynomial ℝ)
name: p
t: p = fun m ↦ ∏ i : Fin 5, ((X : Polynomial ℝ) - m i)
name: hp
t: Polynomial ℝ → ℕ
name: numnzcoeff
t: numnzcoeff = fun p ↦ {j ∈ Finset.range (p.natDegree + 1) | coeff p j ≠ 0}.card
name: hnumnzcoeff
Conclusions: ((Injective answer ∧ ∀ m : Fin 5 → ℤ, Injective m → numnzcoeff (p answer) ≤ numnzcoeff (p m)))
Answer type: Fin 5 → ℤ
Formal answer: answer = fun (i : Fin (5 : ℕ)) => ((↑(↑i : ℕ) : ℤ) - (2 : ℤ) : ℤ)
Problem: Define polynomials $f_n(x)$ for $n \geq 0$ by $f_0(x)=1$, $f_n(0)=0$ for $n \geq 1$, and
\[
\frac{d}{dx} f_{n+1}(x) = (n+1)f_n(x+1)
\]
for $n \geq 0$. Find, with proof, the explicit factorization of $f_{100}(1)$ into powers of distinct primes.

Answer: 99 if $n = 101$, otherwise 0

Lean 4 formalization:
open Set Filter Topology Real Polynomial Function
Hypotheses: t: ℕ -> Polynomial ℕ
name: f
t: f 0 = 1
name: hf0x
t: ∀ n ≥ 1, (f n).eval 0 = 0
name: hfn0
t: ∀ n : ℕ, derivative (f (n + 1)) = (n + 1) * (Polynomial.comp (f n) (X + 1))
name: hfderiv
Conclusions: (Nat.factorization ((f 100).eval 1) = answer)
Answer type: ℕ → ℕ
Formal answer: answer = fun (n : ℕ) => (if n = (101 : ℕ) then (99 : ℕ) else (0 : ℕ) : ℕ)