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.
%I A376446 #37 Dec 27 2024 10:47:29 %S A376446 8,64,2486,5,4268,8426,8426,2,-1,4,64,4862,8,5,46,4,82,6248,-1,4862, %T A376446 6248,4862,8,5,64,6842,8624,4268,-1,4268,2684,28,82,5,4,8426,28,82,-1, %U A376446 46,4268,46,2684,5,4862,4,2,2684,-1,5,6,8,2486,5,4268,2684,4268,2 %N 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. %C A376446 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). %C A376446 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)). %C A376446 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]. %C A376446 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). %C A376446 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. %C A376446 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}. %C A376446 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}. %C A376446 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). %D A376446 Marco Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6. %H A376446 Marco Ripà, <a href="https://doi.org/10.7546/nntdm.2020.26.3.245-260">On the constant congruence speed of tetration</a>, Notes on Number Theory and Discrete Mathematics, Volume 26, 2020, Number 3, Pages 245—260. %H A376446 Marco Ripà, <a href="https://doi.org/10.7546/nntdm.2021.27.4.43-61">The congruence speed formula</a>, Notes on Number Theory and Discrete Mathematics, 2021, 27(4), 43—61. %H A376446 Marco Ripà, <a href="https://www.researchgate.net/publication/387314761_Twelve_Python_Programs_to_Help_Readers_Test_Peculiar_Properties_of_Integer_Tetration">Twelve Python Programs to Help Readers Test Peculiar Properties of Integer Tetration</a>, ResearchGate, 2024. See pp. 7, 9, 12, 14, 27. %H A376446 Marco Ripà and Luca Onnis, <a href="https://doi.org/10.7546/nntdm.2022.28.3.441-457">Number of stable digits of any integer tetration</a>, Notes on Number Theory and Discrete Mathematics, 2022, 28(3), 441—457. %H A376446 Wikipedia, <a href="https://en.wikipedia.org/wiki/Graham's_number">Graham's Number</a>. %H A376446 Wikipedia, <a href="https://en.wikipedia.org/wiki/Tetration">Tetration</a>. %e A376446 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). %o A376446 (Python) %o A376446 # Function to calculate the p-adic valuation %o A376446 def p_adic_valuation(n, p): %o A376446 count = 0 %o A376446 while n % p == 0 and n != 0: %o A376446 n //= p %o A376446 count += 1 %o A376446 return count %o A376446 # Function to calculate tetration (tower of powers) %o A376446 def tetration(base, height, last_digits=500): %o A376446 results = [base] %o A376446 for n in range(1, height): %o A376446 result = pow(base, results[-1], 10**last_digits) # Only the last last_digits digits %o A376446 results.append(result) %o A376446 return results %o A376446 # Function to find the first non-zero difference and compute modulo 10 %o A376446 def find_difference_mod_10(tetrations): %o A376446 differences = [] %o A376446 for n in range(len(tetrations) - 1): %o A376446 string_n = str(tetrations[n]).zfill(500) # Pad with zeros if needed %o A376446 string_n_plus_1 = str(tetrations[n+1]).zfill(500) %o A376446 # Find the first difference starting from the rightmost digit %o A376446 for i in range(499, -1, -1): # From right to left %o A376446 if string_n[i] != string_n_plus_1[i]: %o A376446 difference = (int(string_n[i]) - int(string_n_plus_1[i])) % 10 %o A376446 differences.append(difference) %o A376446 break %o A376446 return differences %o A376446 # Function to determine the first hyperexponent based on modulo 5 congruences %o A376446 def calculate_initial_exponent(a): %o A376446 mod_5 = a % 5 %o A376446 if mod_5 == 1: %o A376446 valuation = p_adic_valuation(a - 1, 5) %o A376446 initial_exponent = valuation + 2 %o A376446 elif mod_5 in [2, 3]: %o A376446 valuation = p_adic_valuation(a**2 + 1, 5) %o A376446 initial_exponent = valuation + 2 %o A376446 elif mod_5 == 4: %o A376446 valuation = p_adic_valuation(a + 1, 5) %o A376446 initial_exponent = valuation + 2 %o A376446 else: %o A376446 valuation = p_adic_valuation(a**2 - 1, 2) %o A376446 initial_exponent = valuation + 1 %o A376446 return initial_exponent %o A376446 # Main logic %o A376446 try: %o A376446 a = int(input("Enter a positive integer greater than 1: ")) %o A376446 # Check if the number ends with 0 %o A376446 if a % 10 == 0: %o A376446 print(-1) %o A376446 elif a <= 1: %o A376446 raise ValueError("The number must be greater than 1.") %o A376446 else: %o A376446 # Calculate the initial exponent based on modulo 5 congruence %o A376446 initial_exponent = calculate_initial_exponent(a) %o A376446 # Generate tetrations for 30 iterations and the last 500 digits %o A376446 tetrations = tetration(a, 30, last_digits=500) %o A376446 # Find the modulo 10 differences for the 4 required iterations %o A376446 mod_10_differences = find_difference_mod_10(tetrations[initial_exponent-1:initial_exponent+4]) %o A376446 # Optimization of the output %o A376446 if mod_10_differences[:2] == mod_10_differences[2:]: %o A376446 mod_10_differences = mod_10_differences[:2] %o A376446 if len(set(mod_10_differences)) == 1: %o A376446 mod_10_differences = [mod_10_differences[0]] %o A376446 # Convert the list of differences into a string without brackets or commas %o A376446 result_str = ''.join(map(str, mod_10_differences)) %o A376446 # Print the optimized result %o A376446 print(f"a({a}) = {result_str}") %o A376446 except Exception as e: %o A376446 print(f"ERROR!\n{e}") %Y A376446 Cf. A317905, A370211, A372490, A373387. %Y A376446 Cf. A000007, A018247, A018248, A063006, A091661, A091663, A091664, A120817, A120818, A290372, A290373, A290374, A290375. %K A376446 sign,base %O A376446 2,1 %A A376446 _Marco Ripà_, Sep 23 2024