VOOZH about

URL: https://oeis.org/A390598

⇱ A390598 - OEIS


login
A390598
Constant congruence speed in the senary numeral system of the tetration base n, or -1 if n is a multiple of 6.
4
0, 0, 1, 2, 1, 1, -1, 1, 2, 3, 2, 1, -1, 1, 1, 4, 1, 2, -1, 2, 1, 2, 1, 1, -1, 1, 3, 2, 3, 1, -1, 1, 1, 5, 1, 2, -1, 2, 1, 3, 1, 1, -1, 1, 2, 2, 2, 1, -1, 1, 1, 2, 1, 2, -1, 3, 1, 3, 1, 1, -1, 1, 2, 6, 2, 1, -1, 1, 1, 2, 1, 2, -1, 2, 1, 2, 1, 1, -1, 1, 4, 4, 4, 1
OFFSET
0,4
COMMENTS
See A373387 for the definition of "constant congruence speed" in the decimal numeral system.
As for the decimal numeral system case (see A373387), we assume that a(0) = a(1) = 1.
Let ord_2(x) and ord_3(x) indicate, respectively, the 2-adic and 3-adic valuation of x.
If n == 1,5 (mod 6), than a(n) = min(ord_2(n^2 - 1) + ord_3(n^2 - 1)); if n == 3 (mod 6), than a(n) = ord_2(n^2 - 1) - 1; if n == 2,4 (mod 6), than a(n) = ord_3(n^2 - 1); if n == 0 (mod 6), than the congruence speed of n never becomes stable (and thus, a(n) = -1).
LINKS
Marco Ripà, The congruence speed formula, Notes on Number Theory and Discrete Mathematics, 2021, 27(4), 43—61.
Marco Ripà and Gabriele Di Pietro, A Compact Notation for Peculiar Properties Characterizing Integer Tetration, Zenodo, 2025.
Marco Ripà and Luca Onnis, Number of stable digits of any integer tetration, Notes on Number Theory and Discrete Mathematics, 2022, 28(3), 441—457.
Wikipedia, Tetration.
FORMULA
a(n) = min(ord_2(n^2 - 1) + ord_3(n^2 - 1)) for n == 1,5 (mod 6),
a(n) = ord_2(n^2 - 1) - 1 for n == 3 (mod 6),
a(n) = ord_3(n^2 - 1) for n == 2,4 (mod 6),
a(n) = -1 for n == 0 (mod 6).
PROG
(Python)
def v2(x):
count = 0
while x % 2 == 0 and x > 0:
x //= 2
count += 1
return count
def v3(x):
count = 0
while x % 3 == 0 and x > 0:
x //= 3
count += 1
return count
def a(n):
mod_6 = n % 6
if n == 0 or n == 1:
return 0
if mod_6 == 0:
return -1
if mod_6 in {1, 5}:
return min(v2(n * n - 1) - 1, v3(n * n - 1))
elif mod_6 == 3:
return v2(n * n - 1) - 1
elif mod_6 in {2, 4}:
return v3(n * n - 1)
def generate_sequence():
seq = []
for n in range(1001):
seq.append(a(n))
return seq
sequence = generate_sequence()
print("a(0), a(1), a(2), ..., a(1000) =", ", ".join(map(str, sequence)))
CROSSREFS
KEYWORD
sign,base
AUTHOR
Marco Ripà, Nov 12 2025
STATUS
approved