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 A340594 #8 Jan 14 2021 18:12:30 %S A340594 0,0,1,0,1,0,2,2,1,0,1,0,1,1,2,0,1,0,1,3,1,0,2,1,1,3,1,0,2,0,2,2,1,2, %T A340594 1,0,1,1,2,0,4,0,1,2,2,0,1,2,1,1,1,0,1,3,1,2,4,0,2,0,3,2,2,5,1,0,1,1, %U A340594 1,0,3,0,2,4,2,2,2,0,6,2,3,0,1,1,1,2,3,0,2,3,2,2,1,2,1,0,3,2 %N A340594 a(n) is the number of iterations of A340592 starting from n, until 0, 1 or a prime is reached. %C A340594 a(n) = 0 if n is prime. %H A340594 Robert Israel, <a href="/A340594/b340594.txt">Table of n, a(n) for n = 2..10000</a> %F A340594 a(n) = A066247(n)*(1 + a(A340592(n))). %e A340594 A340592(21) = 16, A340592(16) = 14, A340592(14) = 13 is prime, so a(21) = 3. %p A340594 dcat:= proc(L) local i, x; %p A340594 x:= L[-1]; %p A340594 for i from nops(L)-1 to 1 by -1 do %p A340594 x:= 10^(1+ilog10(x))*L[i]+x %p A340594 od; %p A340594 x %p A340594 end proc: %p A340594 f:= proc(n) local F; %p A340594 F:= sort(ifactors(n)[2], (a, b) -> a[1] < b[1]); %p A340594 dcat(map(t -> t[1]$t[2], F)) mod n; %p A340594 end proc: %p A340594 g:= proc(n) option remember; %p A340594 if isprime(n) then 0 else 1 + procname(f(n)) fi %p A340594 end proc: %p A340594 g(0):= 0: g(1):= 0: %p A340594 map(g, [$1..1000]); %Y A340594 Cf. A066247, A340592, A340595. %K A340594 nonn %O A340594 2,7 %A A340594 _J. M. Bergot_ and _Robert Israel_, Jan 13 2021