/-
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 FormalConjecturesUtilNumber of symbols '*' and '^' to write the canonical prime factorization of n
The canonical prime factorization is $n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k}$. The written form is $p_1^{\wedge} e_1 * p_2^{\wedge} e_2 * \cdots * p_k^{\wedge} e_k$, where the $\wedge$ appears only if $e_i > 1$. $a(n) = (\text{number of distinct prime factors}) - 1 +$ $(\text{number of distinct prime factors with exponent } > 1)$.
References:
namespace OeisA110475
The primary defining sequence a.
$a(n)$ is the number of symbols '*' and '^' to write the canonical prime factorization of $n$.
noncomputable def a (n : ℕ) : ℕ :=
let f := Nat.factorization n
let s := f.support
let numDistinctPrimes := s.card
let numAsterisks := numDistinctPrimes - 1
let numCarets := (s.filter fun p => f p > 1).card
numAsterisks + numCaretsTerm theorems verifying the first few values of the sequence against the official OEIS b-file
@[category test, AMS 11]
theorem a_1 : a 1 = 0 := ⊢ a 1 = 0
⊢ 0 + {p ∈ ∅ | (Nat.factorization 1) p > 1}.card = 0
All goals completed! 🐙h2:Nat.Prime 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (fun₀ | 2 => 1) p > 1}.card = 0
simp All goals completed! 🐙
@[category test, AMS 11]
theorem a_3 : a 3 = 0 := by ⊢ a 3 = 0
dsimp [a] ⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (Nat.factorization 3) p > 1}.card = 0
have h3 : Nat.Prime 3 := by ⊢ a 3 = 0 h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (Nat.factorization 3) p > 1}.card = 0 decide h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (Nat.factorization 3) p > 1}.card = 0 h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (Nat.factorization 3) p > 1}.card = 0
rw [Nat.Prime.factorization h3 h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (fun₀ | 3 => 1) p > 1}.card = 0 h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (fun₀ | 3 => 1) p > 1}.card = 0] h3:Nat.Prime 3⊢ (insert 3 ∅).card - 1 + {p ∈ insert 3 ∅ | (fun₀ | 3 => 1) p > 1}.card = 0
simp All goals completed! 🐙
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by ⊢ a 4 = 1
dsimp [a] ⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (Nat.factorization 4) p > 1}.card = 1
have : (4 : ℕ) = 2 ^ 2 := by ⊢ a 4 = 1 this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (Nat.factorization 4) p > 1}.card = 1 rfl this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (Nat.factorization 4) p > 1}.card = 1 this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (Nat.factorization 4) p > 1}.card = 1
rw [this, this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (2 ^ 2).factorization p > 1}.card = 1 this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (fun₀ | 2 => 2) p > 1}.card = 1 Nat.Prime.factorization_pow (by this:4 = 2 ^ 2⊢ Nat.Prime 2 this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (fun₀ | 2 => 2) p > 1}.card = 1 decide All goals completed! 🐙 this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (fun₀ | 2 => 2) p > 1}.card = 1)] this:4 = 2 ^ 2⊢ (insert 2 ∅).card - 1 + {p ∈ insert 2 ∅ | (fun₀ | 2 => 2) p > 1}.card = 1
simp [Finset.filter_singleton] All goals completed! 🐙
@[category test, AMS 11]
theorem a_5 : a 5 = 0 := by ⊢ a 5 = 0
dsimp [a] ⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (Nat.factorization 5) p > 1}.card = 0
have h5 : Nat.Prime 5 := by ⊢ a 5 = 0 h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (Nat.factorization 5) p > 1}.card = 0 decide h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (Nat.factorization 5) p > 1}.card = 0 h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (Nat.factorization 5) p > 1}.card = 0
rw [Nat.Prime.factorization h5 h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (fun₀ | 5 => 1) p > 1}.card = 0 h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (fun₀ | 5 => 1) p > 1}.card = 0] h5:Nat.Prime 5⊢ (insert 5 ∅).card - 1 + {p ∈ insert 5 ∅ | (fun₀ | 5 => 1) p > 1}.card = 0
simp All goals completed! 🐙The set of exceptional integers.
def exceptionalSet : Finset ℕ :=
{1, 2, 3, 4, 5, 6, 7, 9, 11}It is conjectured that $1,2,3,4,5,6,7,9,11$ are the only positive integers which cannot be represented as the sum of two elements of indices $n$ such that $a(n) = 1$.
@[category research open, AMS 11]
theorem conjecture :
∀ m > 0, m ∉ exceptionalSet ↔ ∃ x y : ℕ, a x = 1 ∧ a y = 1 ∧ m = x + y := by ⊢ ∀ m > 0, m ∉ exceptionalSet ↔ ∃ x y, OeisA110475.a x = 1 ∧ OeisA110475.a y = 1 ∧ m = x + y
sorry All goals completed! 🐙end OeisA110475