Putnam 1996 B5
open: first valid proof sets the record
PutnamBench · 1996 B5 · Apache-2.0
PutnamBench contributors (Tsoukalas et al.).
Statement
import Mathlib
theorem LeanGolf.putnambench.putnam_1996_b5
(n : ℕ)
(Δ : (Fin n → ℤˣ) → Fin n → Fin n → ℤ)
(balanced : (Fin n → ℤˣ) → Prop)
(hΔ : ∀ S, ∀ a b, a ≤ b → Δ S a b = ∑ i ∈ Finset.Icc a b, (S i : ℤ))
(hbalanced : ∀ S, balanced S ↔ ∀ a b, a ≤ b → |Δ S a b| ≤ 2) :
{S : Fin n → ℤˣ | balanced S}.ncard = putnam_1996_b5_solution nTrusted statement context
noncomputable section
open Function Nat
abbrev putnam_1996_b5_solution : ℕ → ℕ :=
(fun n : ℕ ↦ 2 ^ ⌊(n + 2) / 2⌋₊ + 2 ^ ⌊(n + 1) / 2⌋₊ - 2)