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

Alternating sum of signs of powers of $3/2$

The sequence $a(n) = -\sum_{k=1}^n (-1)^{\lfloor (3/2)^k \rfloor}$.

References:

@[expose] public sectionnamespace OeisA71532open Finset Filteropen scoped Asymptotics

The sequence $a(n) = -\sum_{k=1}^n (-1)^{\lfloor (3/2)^k \rfloor}$.

def a (n : ℕ) : ℤ := - ∑ k ∈ Icc 1 n, (-1 : ℤ) ^ (3 ^ k / 2 ^ k)

Value of the sequence a at 1.

@[category test, AMS 11] theorem a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙

Value of the sequence a at 2.

@[category test, AMS 11] theorem a_2 : a 2 = 0 := ⊢ a 2 = 0 All goals completed! 🐙

Value of the sequence a at 3.

@[category test, AMS 11] theorem a_3 : a 3 = 1 := ⊢ a 3 = 1 All goals completed! 🐙

Value of the sequence a at 4.

@[category test, AMS 11] theorem a_4 : a 4 = 2 := ⊢ a 4 = 2 All goals completed! 🐙

Value of the sequence a at 5.

@[category test, AMS 11] theorem a_5 : a 5 = 3 := ⊢ a 5 = 3 All goals completed! 🐙set_option linter.style.formal_proof_palomar false in

"Is $a(n)>0$?"

The answer is negative: $a(331523) = -1$. The restriction $n > 2$ excludes the initial zero $a(2) = 0$.

The counterexample and formal proof were developed by Codex (GPT-6), prompted by Samuel Schlesinger.

@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/SamuelSchlesinger/a071532-counterexample/blob/818c9f6b3f1eed9ebd1b3b9481848dc21f3e3243/Counterexample.lean#L28-L35"] theorem conjecture1 : ¬ ∀ n : ℕ, 2 < n → 0 < a n := ⊢ ¬∀ (n : ℕ), 2 < n → 0 < OeisA71532.a n All goals completed! 🐙

For $n$ large enough, does $a(n) > \sqrt{n}$ always hold?

@[category research open, AMS 11] theorem conjecture2 : ∃ N : ℕ, ∀ n : ℕ, N ≤ n → (a n : ℝ) > Real.sqrt (n : ℝ) := ⊢ ∃ N, ∀ (n : ℕ), N ≤ n → ↑(OeisA71532.a n) > √↑n All goals completed! 🐙

Conjecture: asymptotically, $a(n) \sim C \log(n)^2$ for some constant $C > 0$.

@[category research open, AMS 11] theorem conjecture3 : ∃ C : ℝ, 0 < C ∧ (fun n : ℕ ↦ (a n : ℝ)) ~[atTop] (fun n : ℕ ↦ C * Real.log (n : ℝ) ^ 2) := ⊢ ∃ C, 0 < C ∧ (fun n ↦ ↑(a n)) ~[atTop] fun n ↦ C * Real.log ↑n ^ 2 All goals completed! 🐙def conjecture3_value.answer : ℝ := sorry

Conjecture: the constant $C$ in $a(n) \sim C \log(n)^2$ is approximately $1.4$.

@[category research open, question value, AMS 11] theorem conjecture3_value : |conjecture3_value.answer - 1.4| < 0.1 ∧ (fun n : ℕ ↦ (a n : ℝ)) ~[atTop] (fun n : ℕ ↦ conjecture3_value.answer * Real.log (n : ℝ) ^ 2) := ⊢ |conjecture3_value.answer - 1.4| < 0.1 ∧ (fun n ↦ ↑(a n)) ~[atTop] fun n ↦ conjecture3_value.answer * Real.log ↑n ^ 2 All goals completed! 🐙end OeisA71532