This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A358052 #21 Jan 29 2023 04:38:33 %S A358052 1,2,2,2,1,2,2,1,2,2,2,2,1,3,2,2,2,2,3,3,2,2,2,1,1,2,3,2,2,2,3,2,3,4, %T A358052 3,2,2,2,1,2,1,3,2,3,2,2,2,2,1,2,3,2,3,3,2,2,2,2,3,2,1,3,4,3,3,2,2,2, %U A358052 2,2,3,2,3,4,3,3,3,2,2,2,2,1,1,3,1,4,2,2,3,3,2,2,2,4,3,3,3,2,3 %N A358052 Triangular array read by rows. For T(n,k) where 1 <= k <= n, start with x = k and repeat the map x -> floor(n/x) + (n mod x) until an x occurs that has already appeared. The number of applications of the map is T(n,k). %C A358052 T(n,k) = 1 if k^2 >= n > k and k-1 divides n-k. %C A358052 If A234575(n,k) = j then either T(n,k) = T(n,j)+1 and A357554(n,k) = A357554(n,j), or T(n,k) = T(n,j), A357554(n,k) = k and A357554(n,j) = j. %H A358052 Robert Israel, <a href="/A358052/b358052.txt">Table of n, a(n) for n = 1..10011</a>(rows 1 to 141, flattened) %e A358052 For T(13,2) we have 2 -> floor(13/2) + (13 mod 2) = 7 -> floor(13/7) + (13 mod 7) = 7. That is two applications of the map so T(13,2) = 2. %e A358052 Triangle starts: %e A358052 1; %e A358052 2, 2; %e A358052 2, 1, 2; %e A358052 2, 1, 2, 2; %e A358052 2, 2, 1, 3, 2; %e A358052 2, 2, 2, 3, 3, 2; %e A358052 2, 2, 1, 1, 2, 3, 2; %e A358052 2, 2, 3, 2, 3, 4, 3, 2; %e A358052 2, 2, 1, 2, 1, 3, 2, 3, 2; %e A358052 2, 2, 2, 1, 2, 3, 2, 3, 3, 2; %p A358052 f:= proc(n, k) local x, S,count; %p A358052 S:= {k}; %p A358052 x:= k; %p A358052 for count from 1 do %p A358052 x:= iquo(n, x) + irem(n, x); %p A358052 if member(x, S) then return count fi; %p A358052 S:= S union {x}; %p A358052 od %p A358052 end proc: %p A358052 for n from 1 to 20 do seq(f(n, k), k=1..n) od; %t A358052 f[n_, k_] := Module[{x, S, count}, S = {k}; x = k; For[count = 1, True, count++, x = Quotient[n, x] + Mod[n, x]; If[MemberQ[S, x], Return[count]]; S = S~Union~{x}]]; %t A358052 Table[f[n, k], {n, 1, 20}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Jan 29 2023, after Maple code *) %Y A358052 Cf. A234575, A357554. %K A358052 nonn,tabl %O A358052 1,2 %A A358052 _J. M. Bergot_ and _Robert Israel_, Oct 27 2022