%I #118 Aug 17 2024 23:25:01
%S 0,1,1,2,1,2,1,1,1,1,1,1,4,1,1,2,1,1,1,1,2,3,2,1,1,1,1,2,1,1,2,1,1,1,
%T 1,1,1,2,1,2,1,1,1,2,2,1,1,1,3,1,3,1,1,1,1,1,1,6,1,1,3,1,1,1,1,2,2,2,
%U 1,1,1,1,2,1,1,2,1,1,1,1,1,1,2,1,5,1,1
%N Convergence speed of m^^m, where m = A067251(n) and n >= 2. a(n) = f(m, m) - f(m, m - 1), where f(x, y) corresponds to the maximum value of k, such that x^^y == x^^(y + 1) (mod 10^k).
%C It is possible to anticipate the convergence speed of a^^m, where ^^ indicates tetration or hyper-4 (e.g., 3^^4=3^(3^(3^3))), simply looking at the congruence (mod 25) of m. In fact, assuming m > 2, a(n) = 1 for any m == 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23 (mod 25), and a(n) >= 2 otherwise.
%C It follows that 32/45 = 71.11% of the a(n) assume unitary value.
%C You can also obtain an arbitrary high convergence speed, such as taking the beautiful base b = 999...99 (9_9_9... n times), which gives a(n) = len(b), for any len(b) > 1. Thus, 99...9^^m == 99...9^^(m + 1) (mod m*10^len(b)), as proved by Ripà in "La strana coda della serie n^n^...^n", pages 25-26. In fact, m = 99...9 == 24 (mod 25) and a(m=24) > 1.
%C From _Marco Ripà_, Dec 19 2021: (Start)
%C Knowing the "constant congruence speed" of a given base (a.k.a. the convergence speed of the base m, assuming m > 2) is very useful in order to calculate the exact number of stable digits of all its tetrations of height b > 1. As an example, let us consider all the a(n) such that n is congruent to 4 (mod 9) (i.e., all the tetration bases belonging to the congruence class 5 (mod 10)). Then, the exact number of stable digits (#S(m, b)) of any tetration m^^b (i.e., the number of its last "frozen" digits) such that m is congruent to 5 (mod 10), for any b >= 3, can automatically be calculated by simply knowing that (under the stated constraint) the congruence speed of the m corresponds to the 2-adic valuation of (m^2 - 1) minus 1. Thus, let k = 1, 2, 3, ..., and we have that
%C If m = 20*k - 5, then #S(m, b > 2) = b*(v_2(m^2 - 1) - 1) + 1 = b*(v_2(m + 1) + 1);
%C If m = 20*k + 5, then #S(m, b > 2) = (b + 1)*(v_2(m^2 - 1) - 1) = (b + 1)*(v_2(m - 1));
%C If m = 5, then #S(m, 1) = 1, #S(m, 2) = 4, #S(m, b > 2) = 8 + 2*(b - 3).
%C (End)
%C From _Marco Ripà_, Feb 17 2022: (Start)
%C For any n > 2, the value of a(n) depends on the congruence modulo 18 of n, since the constant congruence speed of m arises from the 14 nontrivial solutions of the fundamental equation y^5 = y in the (commutative) ring of decadic integers (e.g., y = -1 = ...9999 is a solution of y^5 = y, so it originates the law a(n) = min(v_2(m + 1), v_5(m + 1)) concerning every n belonging to the congruence class 0 modulo 18, as stated in the "Formula" section of the present sequence).
%C (End)
%D Marco Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6
%H Michel Marcus, <a href="/A317905/a317905.gp.txt">reducetower.gp</a> (from Math StackExchange).
%H Math StackExchange, <a href="https://math.stackexchange.com/questions/630134/calculating-an-pmod-m-in-the-general-case">Calculating a^n (mod m) in the general case</a>
%H Marco Ripà, <a href="https://www.researchgate.net/publication/328493277_On_the_Convergence_Speed_of_Tetration">On the Convergence Speed of Tetration</a>, ResearchGate (2018).
%H 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 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 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 Wikipedia, <a href="https://en.wikipedia.org/wiki/Tetration">Tetration</a>
%F Let n > 2. For any integer c >= 0, if n is an element of the set {5,7,14,17,22,23,24,29,32,39,41,45,46}, then a(n+45*c) >= 2; whereas a(n) = 1 otherwise. - _Marco Ripà_, Sep 28 2018
%F If n == 5 (mod 9), then a(n) = v_2(a(n)^2 - 1) - 1, where v_2(x) indicates the 2-adic valuation of x. - _Marco Ripà_, Dec 19 2021
%F If n == 1 (mod 18) and n<>1, then a(n) = min(v_2(m - 1), v_5(m - 1)) (i.e., 1 plus the number of trailing zeros, if any, next to the rightmost digit of m);
%F if n == 10 (mod 18), then a(n) = min(v_2(m + 1), v_5(m - 1));
%F if n == {2,8}(mod 9) and n<>2, then a(n) = v_5(m^2 + 1);
%F if n == {3,7}(mod 18), then a(n) = min(v_2(m + 1), v_5(n^2 + 1));
%F if n == {12,16}(mod 18), then a(n) = min(v_2(m - 1), v_5(n^2 + 1));
%F if n == 4 (mod 9), then a(n) = v_5(m + 1);
%F if n == 5 (mod 18), then a(n) = v_2(m - 1);
%F if n == 14 (mod 18), then a(n) = v_2(m + 1);
%F if n == 6 (mod 9), then a(n) = v_5(m - 1);
%F if n == 9 (mod 18), then a(n) = min(v_2(m - 1), v_5(m + 1));
%F if n == 0 (mod 18), then a(n) = min(v_2(m + 1), v_5(m + 1)) (i.e., number of digits of the rightmost repunit "9's" of m); where v_2(x) and v_5(x) indicates the 2-adic valuation of (x) and the 5-adic valuation of (x), respectively. - _Marco Ripà_, Feb 17 2022
%e For m = 25, a(23) = 3 implies that 25^^(25+i) freezes 3*i "new" rightmost digits (i >= 0).
%o (PARI) \\ uses reducetower.gp from links
%o f2(x,y) = my(k=0); while(reducetower(x, 10^k, y) == reducetower(x, 10^k, y+1), k++); k;
%o f1(n) = polcoef(x*(x+1)*(x^4-x^3+x^2-x+1)*(x^4+x^3+x^2+x+1) / ((x-1)^2*(x^2+x+1)*(x^6+x^3+1)) + O(x^(n+1)), n, x); \\ A067251
%o a(n) = my(m=f1(n)); f2(m, m) - f2(m, m-1);
%o lista(nn) = {for (n=2, nn, print1(a(n), ", "););} \\ _Michel Marcus_, Jan 27 2021
%Y Cf. A067251, A317824, A317903, A349425, A370211, A370775, A371129, A371671, A371720, A372490, A373387.
%Y Cf. A000007, A018247, A018248, A063006, A091661, A091663, A091664, A120817, A120818, A290372, A290373, A290374, A290375.
%K nonn,base
%O 2,4
%A _Marco Ripà_, Aug 10 2018
%E Edited by _Jinyuan Wang_, Aug 30 2020