cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A376446 Modular phase shift of the tetration base n written by juxtaposing its representative congruence classes modulo 10 taken by starting from height 2 + v(n), and a(n) = -1 if n is a multiple of 10.

Original entry on oeis.org

8, 64, 2486, 5, 4268, 8426, 8426, 2, -1, 4, 64, 4862, 8, 5, 46, 4, 82, 6248, -1, 4862, 6248, 4862, 8, 5, 64, 6842, 8624, 4268, -1, 4268, 2684, 28, 82, 5, 4, 8426, 28, 82, -1, 46, 4268, 46, 2684, 5, 4862, 4, 2, 2684, -1, 5, 6, 8, 2486, 5, 4268, 2684, 4268, 2
Offset: 2

Views

Author

Marco Ripà, Sep 23 2024

Keywords

Comments

Let b := 2 + v(n), where v(n) is equal to u_5(n - 1) iff n == 1 (mod 5), u_5(n^2 + 1) iff n == 2,3 (mod 5), u_5(n + 1) iff n == 4 (mod 5), u_2(n^2 - 1) - 1 iff n == 5 (mod 10), while u_5 and u_2 indicate the 5-adic and the 2-adic valuation of the argument (respectively).
Assuming that n is not a multiple of 10, we define as modular phase shift (original name "sfasamento modulare" - see References, “La strana coda della serie n^n^...^n”, Chapter 7) the subsequence of the 4 (or 2 or even 1) congruence classes of the differences between the rightmost non-stable digits of n^^b (i.e., the least significant digit of the tetration n^^b that is not frozen as we move to n^^(b + 1)) and the corresponding digit of n^^(b + 1), and ditto for (n^^(b + 1) and n^^(b + 2)), (n^^(b + 2) and n^^(b + 3)), (n^^(b + 3) and n^^(b + 4)).
Now, let us indicate this subsequence as [s_1, s_2, s_3, s_4] and then, if s_1 = s_3 and also s_2 = s_4, we transform [s_1, s_2, s_3, s_4] into [s_1, s_2], and lastly, if s_1 = s_2, we transform [s_1, s_2] into [s_1].
Finally, we get a(n) by juxtaposing all the 4 (or 2, or 1) digits inside [...] (e.g., if n = 3, then b = 2 + 1 so that we get s_1 = 6 = s_3 and s_2 = 4 = s_4, and consequently a(3) = 64 instead of 6464).
Assuming that n is not a multiple of 10, in general, for any given pair of nonnegative integers c and k, the congruence class modulo 10 of the difference between the least significant digits of n^^(b+c+4*k) and n^^(b+c+1+4*k) does not depend on k. Moreover, if s_1 <> s_2, then s_1 + s_3 = s_2 + s_4 = 10.
In detail, if the last digit of n is 5, then a(n) = 5, while if n is coprime to 5, a(n) mandatorily belongs to the following set: {1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 28, 37, 46, 64, 73, 82, 91, 1397, 1793, 2486, 2684, 3179, 3971, 4268, 4862, 6248, 6842, 7139, 7931, 8426, 8624, 9317, 9713}.
The author conjectures that if n is not a multiple of 10, then a(n) is necessarily an element of the subset {2, 4, 5, 6, 8, 9, 19, 28, 46, 64, 82, 91, 1397, 1793, 2486, 2684, 3179, 3971, 4268, 4862, 6248, 6842, 7139, 7931, 8426, 8624, 9317, 9713}.
As a mere consequence of a(3) = 64 and the fact that congruence speed of 3 is 0 at height 1 and 1 at any height above 1, it follows that 4 is equal to the difference between the slog_3(G)-th least significant digit of Graham's number, G, and the slog_3(G)-th least significant digit of any power tower of the form 3^3^3^... whose height is above slog_3(G) (where slog(...) indicates the super-logarithm of the argument).

Examples

			a(3) = 64 since the congruence speed of 3 at height 3^^(2 + u_5(3^2 + 1)) is constant and its value is 1, so (3^(3^3) - 3^(3^(3^3)))/10^2 == 6 (mod 10) while (3^(3^(3^3)) - 3^(3^(3^(3^3))))/10^3 == 4 (mod 10).
		

References

  • Marco Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6.

Crossrefs

Programs

  • Python
    # Function to calculate the p-adic valuation
    def p_adic_valuation(n, p):
        count = 0
        while n % p == 0 and n != 0:
            n //= p
            count += 1
        return count
    # Function to calculate tetration (tower of powers)
    def tetration(base, height, last_digits=500):
        results = [base]
        for n in range(1, height):
            result = pow(base, results[-1], 10**last_digits)  # Only the last last_digits digits
            results.append(result)
        return results
    # Function to find the first non-zero difference and compute modulo 10
    def find_difference_mod_10(tetrations):
        differences = []
        for n in range(len(tetrations) - 1):
            string_n = str(tetrations[n]).zfill(500)  # Pad with zeros if needed
            string_n_plus_1 = str(tetrations[n+1]).zfill(500)
            # Find the first difference starting from the rightmost digit
            for i in range(499, -1, -1):  # From right to left
                if string_n[i] != string_n_plus_1[i]:
                    difference = (int(string_n[i]) - int(string_n_plus_1[i])) % 10
                    differences.append(difference)
                    break
        return differences
    # Function to determine the first hyperexponent based on modulo 5 congruences
    def calculate_initial_exponent(a):
        mod_5 = a % 5
        if mod_5 == 1:
            valuation = p_adic_valuation(a - 1, 5)
            initial_exponent = valuation + 2
        elif mod_5 in [2, 3]:
            valuation = p_adic_valuation(a**2 + 1, 5)
            initial_exponent = valuation + 2
        elif mod_5 == 4:
            valuation = p_adic_valuation(a + 1, 5)
            initial_exponent = valuation + 2
        else:
            valuation = p_adic_valuation(a**2 - 1, 2)
            initial_exponent = valuation + 1
        return initial_exponent
    # Main logic
    try:
        a = int(input("Enter a positive integer greater than 1: "))
        # Check if the number ends with 0
        if a % 10 == 0:
            print(-1)
        elif a <= 1:
            raise ValueError("The number must be greater than 1.")
        else:
            # Calculate the initial exponent based on modulo 5 congruence
            initial_exponent = calculate_initial_exponent(a)
            # Generate tetrations for 30 iterations and the last 500 digits
            tetrations = tetration(a, 30, last_digits=500)
            # Find the modulo 10 differences for the 4 required iterations
            mod_10_differences = find_difference_mod_10(tetrations[initial_exponent-1:initial_exponent+4])
            # Optimization of the output
            if mod_10_differences[:2] == mod_10_differences[2:]:
                mod_10_differences = mod_10_differences[:2]
            if len(set(mod_10_differences)) == 1:
                mod_10_differences = [mod_10_differences[0]]
            # Convert the list of differences into a string without brackets or commas
            result_str = ''.join(map(str, mod_10_differences))
            # Print the optimized result
            print(f"a({a}) = {result_str}")
    except Exception as e:
        print(f"ERROR!\n{e}")