/- 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

Representations $n = k^2 + m$ ($0 < k^2 \le m$) with $\sigma(k^2) + \phi(m)$ prime

Let $\sigma$ denote the sum-of-divisors function and $\phi$ denote Euler's totient function. The sequence $a(n)$ counts the representations $n = k^2 + m$ ($0 < k^2 \le m$) such that $\sigma(k^2) + \phi(m)$ is prime.

References:

@[expose] public sectionnamespace OeisA233544open ArithmeticFunctionopen scoped ArithmeticFunction.sigma

Number of ways to write $n = k^2 + m$ with $k > 0$ and $m \ge k^2$ such that $\sigma(k^2) + \phi(m)$ is prime, where $\sigma(k^2)$ is the sum of all positive divisors of $k^2$, and $\phi$ is Euler's totient function.

def a (n : ℕ) : ℕ := ∑ k ∈ (Finset.Icc 1 n).filter (fun k => 2 * k ^ 2 ≤ n), let m := n - k ^ 2 if Nat.Prime (σ 1 (k ^ 2) + m.totient) then 1 else 0@[category test, AMS 11] theorem a_1 : a 1 = 0 := ⊢ a 1 = 0 ⊢ (∑ k ∈ Finset.Icc 1 1 with 2 * k ^ 2 ≤ 1, have m := 1 - k ^ 2; if Nat.Prime ((σ 1) (k ^ 2) + m.totient) then 1 else 0) = 0; ⊢ (∑ x ∈ Finset.Icc 1 1 with 2 * x ^ 2 ≤ 1, if Nat.Prime (∑ x ∈ (x ^ 2).divisors, x + (1 - x ^ 2).totient) then 1 else 0) = 0; All goals completed! 🐙@[category test, AMS 11] theorem a_2 : a 2 = 1 := ⊢ a 2 = 1 ⊢ (∑ k ∈ Finset.Icc 1 2 with 2 * k ^ 2 ≤ 2, have m := 2 - k ^ 2; if Nat.Prime ((σ 1) (k ^ 2) + m.totient) then 1 else 0) = 1; ⊢ (∑ x ∈ Finset.Icc 1 2 with 2 * x ^ 2 ≤ 2, if Nat.Prime (∑ x ∈ (x ^ 2).divisors, x + (2 - x ^ 2).totient) then 1 else 0) = 1; All goals completed! 🐙@[category test, AMS 11] theorem a_3 : a 3 = 1 := ⊢ a 3 = 1 ⊢ (∑ k ∈ Finset.Icc 1 3 with 2 * k ^ 2 ≤ 3, have m := 3 - k ^ 2; if Nat.Prime ((σ 1) (k ^ 2) + m.totient) then 1 else 0) = 1; ⊢ (∑ x ∈ Finset.Icc 1 3 with 2 * x ^ 2 ≤ 3, if Nat.Prime (∑ x ∈ (x ^ 2).divisors, x + (3 - x ^ 2).totient) then 1 else 0) = 1; All goals completed! 🐙@[category test, AMS 11] theorem a_4 : a 4 = 1 := ⊢ a 4 = 1 ⊢ (∑ k ∈ Finset.Icc 1 4 with 2 * k ^ 2 ≤ 4, have m := 4 - k ^ 2; if Nat.Prime ((σ 1) (k ^ 2) + m.totient) then 1 else 0) = 1; ⊢ (∑ x ∈ Finset.Icc 1 4 with 2 * x ^ 2 ≤ 4, if Nat.Prime (∑ x ∈ (x ^ 2).divisors, x + (4 - x ^ 2).totient) then 1 else 0) = 1; All goals completed! 🐙@[category test, AMS 11] theorem a_9 : a 9 = 2 := ⊢ a 9 = 2 ⊢ (∑ k ∈ Finset.Icc 1 9 with 2 * k ^ 2 ≤ 9, have m := 9 - k ^ 2; if Nat.Prime ((σ 1) (k ^ 2) + m.totient) then 1 else 0) = 2; ⊢ (∑ x ∈ Finset.Icc 1 9 with 2 * x ^ 2 ≤ 9, if Nat.Prime (∑ x ∈ (x ^ 2).divisors, x + (9 - x ^ 2).totient) then 1 else 0) = 2; All goals completed! 🐙

Conjecture (i): $a(n) > 0$ for all $n > 1$.

    Zhi-Wei Sun

@[category research open, AMS 11] theorem conjecture_1 (n : ℕ) (hn : 1 < n) : 0 < a n := n:ℕhn:1 < n⊢ 0 < a n All goals completed! 🐙

Conjecture (ii): Any integer $n > 1$ can be written as $k + m$ with $k > 0$ and $m > 0$ such that $\sigma(k)^2 + \phi(m)$ is prime.

    Zhi-Wei Sun

@[category research open, AMS 11] theorem conjecture_2 (n : ℕ) (hn : 1 < n) : ∃ k m : ℕ, 0 < k ∧ 0 < m ∧ n = k + m ∧ Nat.Prime (σ 1 k ^ 2 + m.totient) := n:ℕhn:1 < n⊢ ∃ k m, 0 < k ∧ 0 < m ∧ n = k + m ∧ Nat.Prime ((σ 1) k ^ 2 + m.totient) All goals completed! 🐙

Conjecture (ii): Any integer $n > 1$ can be written as $k + m$ with $k > 0$ and $m > 0$ such that $\sigma(k) + \phi(m)^2$ is prime.

    Zhi-Wei Sun

@[category research open, AMS 11] theorem conjecture_3 (n : ℕ) (hn : 1 < n) : ∃ k m : ℕ, 0 < k ∧ 0 < m ∧ n = k + m ∧ Nat.Prime (σ 1 k + m.totient ^ 2) := n:ℕhn:1 < n⊢ ∃ k m, 0 < k ∧ 0 < m ∧ n = k + m ∧ Nat.Prime ((σ 1) k + m.totient ^ 2) All goals completed! 🐙end OeisA233544