login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Table T(n,k) with n>=1 and k>=0, read by downwards antidiagonals where the n-th row is the sequence given by a(0) = 0 and a(k) = k - a(floor(a(k-1)/n)).
2

%I #18 Jan 04 2024 21:41:41

%S 0,1,0,1,1,0,2,2,1,0,3,2,2,1,0,3,3,3,2,1,0,4,4,3,3,2,1,0,4,4,4,4,3,2,

%T 1,0,5,5,5,4,4,3,2,1,0,6,6,6,5,5,4,3,2,1,0,6,7,6,6,5,5,4,3,2,1,0,7,8,

%U 7,7,6,6,5,4,3,2,1,0,8,8,8,8,7,6,6,5,4

%N Table T(n,k) with n>=1 and k>=0, read by downwards antidiagonals where the n-th row is the sequence given by a(0) = 0 and a(k) = k - a(floor(a(k-1)/n)).

%F First 5 rows: A005206, A286389, A366860, A366870, A366871.

%F Conjecture: if a(k) is the fixed point of the morphism 0->R(n), 1->R(n)0, then the partial sum of a(k) is the Hofstadter-like sequence b(k): b(0)=0, b(k) = k - b(floor(b(k-1)/n)), i.e., the partial sum of the n-th row of A368281 is the n-th row of A368282. The cases n=1 and n=2 are known to be true (see A005206, A286389).

%e Table begins:

%e k

%e n=1: 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, ...

%e n=2: 0, 1, 2, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 10, 11, 12, 13, 14, 14, ...

%e n=3: 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, ...

%e n=4: 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, ...

%e n=5: 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 15, 16, ...

%e n=6: 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, ...

%e n=7: 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, ...

%t a[n_, k_] := a[n, k] = Module[{r}, If[k == 0, Return[0]]; r = k - a[n, Quotient[a[n, k - 1], n]]; r];

%t Flatten[Table[a[n - k + 1, k - 1], {n, 0, 13}, {k, n, 1, -1}]] (* _Robert P. P. McKone_, Dec 20 2023 *)

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def A368282_T(n,k):

%o if k == 0: return 0

%o return k-A368282_T(n,A368282_T(n,k-1)//n)

%Y Cf. A005206, A286389, A366860, A366870, A366871, A368281.

%Y Cf. A002260, A004736.

%K nonn,tabl

%O 1,7

%A _Chai Wah Wu_, Dec 19 2023