Show full file and definitions
/-
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.
-/
module
public import FormalConjecturesUtil
/-!
# Number 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:*
- [A110475](https://oeis.org/A110475)
-/
@[expose] public section
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 + numCarets
/-- Term 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 := by
dsimp [a]
simp
@[category test, AMS 11]
theorem a_2 : a 2 = 0 := by
dsimp [a]
have h2 : Nat.Prime 2 := by decide
rw [Nat.Prime.factorization h2]
simp
@[category test, AMS 11]
theorem a_3 : a 3 = 0 := by
dsimp [a]
have h3 : Nat.Prime 3 := by decide
rw [Nat.Prime.factorization h3]
simp
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by
dsimp [a]
have : (4 : ℕ) = 2 ^ 2 := by rfl
rw [this, Nat.Prime.factorization_pow (by decide)]
simp [Finset.filter_singleton]
@[category test, AMS 11]
theorem a_5 : a 5 = 0 := by
dsimp [a]
have h5 : Nat.Prime 5 := by decide
rw [Nat.Prime.factorization h5]
simp
/-- 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
sorry
end OeisA110475