import Mathlib def f (n : ℕ) : ℕ := ((Finset.Icc 1 n).filter (fun k => Nat.digits 10 k = (Nat.digits 10 k).reverse)).card