A345228 Square array T(m, n), read by ascending antidiagonals. Let f(k) = k/2 if k is even, otherwise ((2*n+1)*k + 2*T(m, n) + 1)/2, T(m, n) is the smallest integer greater than -1, where m = f^j(m) for j > 0 exists. f^j(m) means the j-th iterate of f(m).
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 3, 0, 0, 2, 2, 0, 2, 3, 1, 0, 2, 3, 0, 1, 2, 10, 0, 2, 1, 3, 0, 0, 1, 7, 3, 2, 1, 3, 4, 0, 7, 0, 4, 2, 17, 1, 3, 5, 4, 0, 6, 7, 1, 1, 4, 10, 3, 0, 4, 5, 0, 5, 6, 22, 0, 7, 7, 24, 4, 1, 2, 5, 0, 4, 5, 19, 7, 2, 4, 17, 3, 4, 2
Offset: 0
Examples
Twelve initial terms of rows 0-10 are listed below: n |m-> 0: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ... 1: 0, 0, 0, 1, 2, 2, 1, 3, 5, 4, 2, 3, ... 2: 0, 0, 0, 0, 0, 2, 1, 3, 0, 1, 2, 3, ... 3: 0, 0, 0, 1, 0, 2, 1, 3, 4, 4, 2, 5, ... 4: 0, 3, 3, 10, 3, 17, 10, 24, 3, 31, 17, 23, ... 5: 0, 2, 2, 7, 2, 4, 7, 17, 2, 21, 4, 27, ... 6: 0, 1, 1, 4, 1, 7, 4, 10, 1, 13, 7, 4, ... 7: 0, 0, 0, 1, 0, 2, 1, 3, 0, 4, 2, 5, ... 8: 0, 7, 7, 22, 7, 37, 22, 52, 7, 67, 37, 82, ... 9: 0, 6, 6, 19, 6, 32, 19, 14, 6, 58, 32, 71, ... 10: 0, 5, 5, 16, 5, 27, 16, 38, 5, 49, 27, 35, ... We may see this sequence as a sequence of functions: in m=1: 0 -> f_n1_0(k) = k/2; (3*k+1)/2. 1 -> f_n1_1(k) = k/2; (3*k+3)/2. 2 -> f_n1_2(k) = k/2; (3*k+5)/2. in m=2: 0 -> f_n2_0(k) = k/2; (5*k+1)/2. 1 -> f_n2_1(k) = k/2; (5*k+3)/2. 2 -> f_n2_2(k) = k/2; (5*k+5)/2. T(1, 4) = 3 because: f_n4_3(1) = (9 + 7)/2 = 16, f_n4_3(18) = 16/2 = 8, f_n4_3(8) = 8/2 = 4, f_n4_3(4) = 4/2 = 2, f_n4_3(2) = 2/2 = 1. This shows that f_n4_3(f_n4_3(f_n4_3(f_n4_3(f_n4_3(1))))) = 1. T(1, 4) is not < 2 because no such loop which includes 1 exists for f_n4_0, f_n4_1 and f_n4_2.
Links
Programs
-
PARI
\\ uses magic constant 10^5 isperiodic(v, z) = for (k=1, #v, if (v[k] == z, return(1))); f(tmn, m, n) = if (m%2, ((2*n+1)*m+2*tmn+1)/2, m/2); isok(m, n, tmn) = {my(v=[m], y=m); for (i=1, oo, my(z=f(tmn, y, n)); if (z > 10^5, return (0)); if (z == m, return (1)); if (isperiodic(v, z), return(0)); v = concat(v, z); y = z; ); } T(m,n) = {my(tmn=0); while (!isok(m, n, tmn), tmn++); tmn; } matrix(15,15, n, k, T(k-1, n-1)) \\ Michel Marcus, Jun 17 2021
Formula
T(1, n) = A035327(n) for n > 2.
Comments