/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilSmallest palindrome with exactly $n$ divisors
The sequence $a(n)$ is the smallest palindromic number with exactly $n$ divisors, or $0$ if no such number exists.
References:
namespace OeisA83753A natural number $m$ is a decimal palindrome if its base-$10$ digits read the same forwards and backwards.
def IsDecimalPalindrome (m : ℕ) : Prop :=
Nat.digits 10 m = (Nat.digits 10 m).reverseinstance (m : ℕ) : Decidable (IsDecimalPalindrome m) :=
inferInstanceAs (Decidable (Nat.digits 10 m = (Nat.digits 10 m).reverse))open Classical inSmallest positive palindrome with exactly $n$ divisors, or $0$ if no such number exists.
noncomputable def a (n : ℕ) : ℕ :=
if h : ∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ (Nat.divisors m).card = n then
Nat.find h
else
0
Value of the sequence a at 1.
pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 1⊢ (0 < 1 ∧ IsDecimalPalindrome 1 ∧ (Nat.divisors 1).card = 1) ∧
∀ n < 1, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 1)
decide +native All goals completed! 🐙
· neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 1⊢ False exact (h ⟨1, by h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 1⊢ 0 < 1 ∧ IsDecimalPalindrome 1 ∧ (Nat.divisors 1).card = 1 decide +native All goals completed! 🐙⟩).elim
Value of the sequence a at 2.
@[category test, AMS 11]
theorem a_2 : a 2 = 2 := by ⊢ a 2 = 2
classical
dsimp [a] ⊢ (if h : ∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2 then Nat.find h else 0) = 2
split_ifs with h pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ Nat.find h = 2neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ False
· pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ Nat.find h = 2 rw [Nat.find_eq_iff pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ (0 < 2 ∧ IsDecimalPalindrome 2 ∧ (Nat.divisors 2).card = 2) ∧
∀ n < 2, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 2) pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ (0 < 2 ∧ IsDecimalPalindrome 2 ∧ (Nat.divisors 2).card = 2) ∧
∀ n < 2, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 2)] pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ (0 < 2 ∧ IsDecimalPalindrome 2 ∧ (Nat.divisors 2).card = 2) ∧
∀ n < 2, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 2)
decide +native All goals completed! 🐙
· neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ False exact (h ⟨2, by h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 2⊢ 0 < 2 ∧ IsDecimalPalindrome 2 ∧ (Nat.divisors 2).card = 2 decide +native All goals completed! 🐙⟩).elim
Value of the sequence a at 3.
@[category test, AMS 11]
theorem a_3 : a 3 = 4 := by ⊢ a 3 = 4
classical
dsimp [a] ⊢ (if h : ∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3 then Nat.find h else 0) = 4
split_ifs with h pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ Nat.find h = 4neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ False
· pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ Nat.find h = 4 rw [Nat.find_eq_iff pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ (0 < 4 ∧ IsDecimalPalindrome 4 ∧ (Nat.divisors 4).card = 3) ∧
∀ n < 4, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 3) pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ (0 < 4 ∧ IsDecimalPalindrome 4 ∧ (Nat.divisors 4).card = 3) ∧
∀ n < 4, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 3)] pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ (0 < 4 ∧ IsDecimalPalindrome 4 ∧ (Nat.divisors 4).card = 3) ∧
∀ n < 4, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 3)
decide +native All goals completed! 🐙
· neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ False exact (h ⟨4, by h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 3⊢ 0 < 4 ∧ IsDecimalPalindrome 4 ∧ (Nat.divisors 4).card = 3 decide +native All goals completed! 🐙⟩).elim
Value of the sequence a at 4.
@[category test, AMS 11]
theorem a_4 : a 4 = 6 := by ⊢ a 4 = 6
classical
dsimp [a] ⊢ (if h : ∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4 then Nat.find h else 0) = 6
split_ifs with h pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ Nat.find h = 6neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ False
· pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ Nat.find h = 6 rw [Nat.find_eq_iff pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ (0 < 6 ∧ IsDecimalPalindrome 6 ∧ (Nat.divisors 6).card = 4) ∧
∀ n < 6, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 4) pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ (0 < 6 ∧ IsDecimalPalindrome 6 ∧ (Nat.divisors 6).card = 4) ∧
∀ n < 6, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 4)] pos h:∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ (0 < 6 ∧ IsDecimalPalindrome 6 ∧ (Nat.divisors 6).card = 4) ∧
∀ n < 6, ¬(0 < n ∧ IsDecimalPalindrome n ∧ n.divisors.card = 4)
decide +native All goals completed! 🐙
· neg h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ False exact (h ⟨6, by h:¬∃ m, 0 < m ∧ IsDecimalPalindrome m ∧ m.divisors.card = 4⊢ 0 < 6 ∧ IsDecimalPalindrome 6 ∧ (Nat.divisors 6).card = 4 decide +native All goals completed! 🐙⟩).elimThere are no palindromic numbers greater than 1 which are the fifth or higher power of a natural number.
@[category research open, AMS 11]
theorem conjecture (m k : ℕ) (hm : 1 < m) (hpal : IsDecimalPalindrome m) (hk : 5 ≤ k) :
¬ ∃ x : ℕ, m = x ^ k := by m:ℕk:ℕhm:1 < mhpal:IsDecimalPalindrome mhk:5 ≤ k⊢ ¬∃ x, m = x ^ k
sorry All goals completed! 🐙end OeisA83753