%I #21 Apr 26 2022 21:13:44
%S 2,4,8,6,1,3,6,2,5,1,2,4,9,9,8,6,3,7,4,8,7,5,0,0,1,2,5,0,0,0,1,3,7,5,
%T 0,1,2,5,1,3,6,2,4,8,7,4,9,8,6,2,5,1,3,7,4,9,8,7,5,1,2,4,8,6,3,6,3,6,
%U 2,4,9,9,9,9,8,7,4,9,9,9,8,6,2,4,9,8,7,4,8,6,3,7,5,1,2,5,0,1,3,7,4,8,6,2,5,0,1
%N Irregular triangle read by rows: T(n,k) is the (n-th)-to-last digit of 2^p such that p == k + A123384(n-1) (mod A005054(n)); k >= 0.
%C The n-th row of this triangle is the cycle of the (n-th)-to-last digit of powers of 2.
%C The period of the last n digits of powers of 2 where the exponent is greater than or equal to n is A005054(n). As a result, this triangle can be used to get the (n-th)-to-last digit of a large power of 2; if p == k + A123384(n-1) (mod A005054(n)), then the (n-th)-to-last digit (base 10) of 2^p is T(n,k). For example, for n = 1, if p == 1 (mod 4), then 2^p == 2 (mod 10) and if p == 3 (mod 4), then 2^p == 8 (mod 10). For n = 2, if p == 4 (mod 20), then the second-to-last digit of 2^p (base 10) is 1 and if p == 7 (mod 20), then the second-to-last digit of 2^p (base 10) is 2.
%F For n > 1, T(n,0) = 1.
%e Irregular triangle begins:
%e n/k| 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... | Number of terms:
%e ---+---------------------------------------+-----------------
%e 1 | 2, 4, 8, 6; | 4
%e 2 | 1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, ... | 20
%e 3 | 1, 2, 5, 0, 0, 0, 1, 3, 7, 5, 0, ... | 100
%e 4 | 1, 2, 4, 8, 6, 2, 5, 1, 2, 4, 8, ... | 500
%e 5 | 1, 3, 6, 3, 6, 2, 4, 9, 9, 8, 7, ... | 2500
%e 6 | 1, 2, 5, 0, 0, 1, 3, 7, 5, 1, 2, ... | 12500
%e ...
%o (PARI) A352378_rows(n)=my(N=logint(10^(n-1),2),k=4*5^(n-1)); vector(k,v,floor(lift(Mod(2,10^n)^(v+N))/(10^(n-1))))
%Y Cf. A005054, A123384, A216099.
%Y The (n-th)-to-last digit of a power of 2: A000689 (n=1), A160590 (n=2).
%K nonn,tabf,base
%O 1,1
%A _Davis Smith_, Mar 14 2022