%I #29 Apr 16 2024 13:34:30
%S 0,0,0,12,0,4,3,24,13,7,6,0,14,0,1,11,12,11,5,5,18,17,12,23,0,15,4,3,
%T 2,4,19,2,8,5,1,1,17,3,4,24,0,13,12,7,5,4,11,14,10,27,23,10,19,14,5,4,
%U 6,10,0,11,14,9,0,12,1,4,14,13,11,10,22,10,29,15
%N Square array read by descending antidiagonals: Define function b(i,n,k) where b(0,n,k) = n, b(1,n,k) = k, b(i,n,k) = A038502(b(i-1,n,k) + b(i-2,n,k)). T(n,k) is the number of steps until reaching the cyclic part of {b(i,n,k)}, or -1 if no cycle exists.
%C b(i,n,k) = (b(i-1,n,k) + b(i-2,n,k)/p^valuation(b(i-1,n,k) + b(i-2,n,k), p), i.e., b(i,n,k) is b(i-1,n,k) + b(i-2,n,k) with all factors of p removed, where p = 3 in this sequence. Therefore, b(i,n,k) is not divisible by 3 for i >= 3.
%C At least one of b(i,n,k) < b(i-1,n,k) + b(i-2,n,k) and b(i+1,n,k) < b(i-1,n,k) + b(i,n,k) is true for i >= 5.
%C It appears that all repetends have the form of (1, 1, 2) (the position of 2 possibly changed), multiplied by G = A038502(gcd(n,k)).
%C Conjecture: T(n,k) >= 0.
%C This conjecture can be supported by a heuristic argument: Using dynamic programming, we can compute that for p's in A000057, the probability that b(i-1,n,k) + b(i-2,n,k) is not divisible by p is (p-2)/p, and the probability that valuation(b(i-1,n,k) + b(i-2,n,k), p) = x (x >= 1) is 2*(p-1)/p^(x+1). Therefore, the mathematical expectation of a(i) is (a(i-1,n,k) + a(i-2,n,k))*(p-1)/(p+1), which is exactly the average of the earlier two terms when p = 3, and larger when p >= 5.
%H Yifan Xie, <a href="/A370526/b370526.txt">Rows n = 1..100 of triangle, flattened</a>
%F T(n,k) = 0 iff n = k, n = 2k or k = 2n and gcd(x,y) is not divisible by 3.
%e Array begins:
%e n\k| 1 2 3 4 5 6 7
%e ---+--------------------------------
%e 1 | 0, 0, 12, 3, 6, 11, 17, ...
%e 2 | 0, 0, 24, 0, 12, 12, 4, ...
%e 3 | 4, 13, 14, 11, 23, 19, 4, ...
%e 4 | 7, 0, 5, 0, 2, 24, 10, ...
%e 5 | 1, 5, 15, 8, 0, 27, 11, ...
%e 6 | 18, 4, 5, 13, 23, 14, 10, ...
%e 7 | 3, 1, 12, 10, 9, 7, 29, ...
%e ...
%e T(1,4) = 3 because its sequence b begins with b(0) = 1, b(1) = 4, b(2) = A038502(1+4) = 5, b(3) = A038502(4+5) = 1, b(4) = 2, b(5) = 1, b(6) = 1, which has reached the cyclic part of (1, 2, 1) at i=3.
%o (PARI) T(n, k)={my(i=-1, z=0); while((z != 2*n || z != 2*k) && (n != 2*z || n != 2*k) && (k != 2*n || k != 2*z), z=n; n=k; k=(z+n)/3^(valuation(z+n, 3)); i++); i; };
%Y Cf. A000057, A038502, A369876.
%K nonn,tabl
%O 1,4
%A _Yifan Xie_, Feb 21 2024