login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A268057
Triangle T(n,k), 1<=k<=n, read by rows: T(n,k) = number of iterations of A048158(n, A048158(n, ... A048158(n, k)...)) to reach 0.
6
1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 3, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 3, 3, 2, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 2, 1, 2, 3, 2, 3, 2, 1, 1, 1, 2, 2, 1, 3, 3, 2, 2, 1, 1, 2, 3, 4, 2, 3, 5, 4, 3, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 2, 2, 1, 1, 2, 2, 2, 3, 2, 3, 4, 3
OFFSET
1,5
COMMENTS
Each column is periodic: T(n+A003418(k),k) = T(n,k). - Robert Israel, Feb 02 2016
LINKS
EXAMPLE
T(5, 3) = 3 because the algorithm requires three steps to reach 0.
5 % 3 = 2
5 % 2 = 1
5 % 1 = 0
Triangle begins:
1
1 1
1 2 1
1 1 2 1
1 2 3 2 1
1 1 1 2 2 1
1 2 2 3 3 2 1
1 1 2 1 3 2 2 1
1 2 1 2 3 2 3 2 1
1 1 2 2 1 3 3 2 2 1
1 2 3 4 2 3 5 4 3 2 1
1 1 1 1 2 1 3 2 2 2 2 1
MAPLE
T:= proc(n, k) option remember; local m;
if k = 0 then 0 else 1 + procname(n, n mod k) fi
end proc:
seq(seq(T(n, k), k=1..n), n=1..30); # Robert Israel, Feb 02 2016
MATHEMATICA
T[n_, k_] := T[n, k] = If[k == 0, 0, 1 + T[n, Mod[n, k]]];
Table[Table[T[n, k], {k, 1, n}], {n, 1, 30}] // Flatten (* Jean-François Alcover, Jan 31 2023, after Robert Israel *)
CROSSREFS
KEYWORD
tabl,nonn
AUTHOR
Peter Kagey, Jan 25 2016
STATUS
approved