Goedel-LM/MathOlympiadBench huggingface dataset:
import Mathlib
import Aesop

set_option maxHeartbeats 0

open BigOperators Real Nat Topology Rat

/-!
# IMO 2023 N5

Let $(a_n)_{n \ge 0}$ be a strictly increasing sequence of positive integers such that:
* For all $k \ge 1$, $a_k$ divides $2(a_0 + a_1 + \dots + a_{k - 1})$.
* For each prime $p$, there exists some $k$ such that $p$ divides $a_k$.

Prove that for any positive integer $n$, there exists some $k$ such that $n$ divides $a_k$.
-/
/- special open -/ open Finset
structure GoodSeq where
  a : ℕ → ℕ
  a_strictMono : StrictMono a
  a_pos : ∀ k, 0 < a k
  a_spec : ∀ k, a k ∣ 2 * ∑ i ∈ range k, a i
  exists_dvd_a_of_prime : ∀ p : ℕ, p.Prime → ∃ k, p ∣ a k

theorem imo_sl_2023_N5 (X : GoodSeq) (N : ℕ) (hN : 0 < N) :
  ∃ k, N ∣ X.a k := by sorry
import Mathlib
import Aesop

set_option maxHeartbeats 0

open BigOperators Real Nat Topology Rat

/-!
# IMO 2023 N6

A sequence $(a_n)_{n ≥ 0}$ is called *kawaii* if $a_0 = 0$, $a_1 = 1$, and for any $n ∈ ℕ$,
$$ a_{n + 2} + 2 a_n = 3 a_{n + 1} \text{ or } a_{n + 2} + 3 a_n = 4 a_{n + 1}. $$
A non-negative integer $m$ is said to be *kawaii* if it belongs to some kawaii sequence.

Let $m ∈ ℕ$ such that both $m$ and $m + 1$ are kawaii.
Prove that $3 ∣ m$ and $m/3$ belongs to a kawaii sequence.
-/
@[ext] structure KawaiiSequence (S : Set ℕ) where
  a : ℕ → ℕ
  a_zero : a 0 = 0
  a_one : a 1 = 1
  a_step : ∀ n, ∃ c : S, a (n + 2) + c * a n = (c + 1) * a (n + 1)

theorem imo_sl_2023_N6 (hn : ∃ (X : KawaiiSequence {2, 3}) (k : ℕ), n = X.a k)
    (hn0 : ∃ (X : KawaiiSequence {2, 3}) (k : ℕ), n + 1 = X.a k) :
    ∃ m, (∃ (X : KawaiiSequence {2, 3}) (k : ℕ), m = X.a k) ∧ n = 3 * m := by sorry
import Mathlib
import Aesop

set_option maxHeartbeats 0

open BigOperators Real Nat Topology Rat

/-!
# IMO 2023 N7

Find all possible values of $a + b + c + d$ across all $a, b, c, d ∈ ℕ^+$ satisfying
$$ \frac{ab}{a + b} + \frac{cd}{c + d} = \frac{(a + b)(c + d)}{a + b + c + d}. $$
-/
class nice (a b c d : ℕ) : Prop where
  a_pos : 0 < a
  b_pos : 0 < b
  c_pos : 0 < c
  d_pos : 0 < d
  spec : ((a * b : ℕ) : ℚ) / (a + b : ℕ) + (c * d : ℕ) / (c + d : ℕ)
    = (a + b : ℕ) * (c + d : ℕ) / (a + b + c + d : ℕ)

theorem imo_sl_2023_N7 (hn : 0 < n) :
    (∃ a b c d, nice a b c d ∧ a + b + c + d = n) ↔ ¬Squarefree n := by sorry