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 A347386 #14 Jan 30 2022 23:04:10 %S A347386 0,0,1,0,2,1,1,0,2,2,2,1,2,1,2,0,3,2,3,2,1,2,2,1,3,2,3,1,3,2,1,0,2,3, %T A347386 2,2,4,3,2,2,2,1,3,2,3,2,2,1,2,3,3,2,4,3,3,1,3,3,3,2,2,1,2,0,2,2,4,3, %U A347386 2,2,3,2,5,4,3,3,2,2,3,2,4,2,2,1,4,3,3,2,4,3,2,2,1,2,3,1,3,2,3,3,4,3,3,2,2 %N A347386 Number of iterations of A347385 (Dedekind psi function applied to the odd part of n) needed to reach a power of 2. %C A347386 Also, for n > 1, one less than the number of iterations of A347385 to reach 1. %H A347386 Antti Karttunen, <a href="/A347386/b347386.txt">Table of n, a(n) for n = 1..20000</a> %F A347386 If A209229(n) = 1, then a(n) = 0, otherwise a(n) = 1 + a(A001615(A000265(n))). %F A347386 For all n >= 1, a(n) <= A331410(n). %t A347386 f[p_, e_] := If[p == 2, 1, (p + 1)*p^(e - 1)]; psiOdd[1] = 1; psiOdd[n_] := Times @@ f @@@ FactorInteger[n]; a[n_] := -1 + Length @ NestWhileList[psiOdd, n, # != 2^IntegerExponent[#, 2] &]; Array[a, 100] (* _Amiram Eldar_, Aug 31 2021 *) %o A347386 (PARI) %o A347386 A347385(n) = if(1==n,n, my(f=factor(n>>valuation(n, 2))); prod(i=1, #f~, f[i, 1]^f[i, 2] + f[i, 1]^(f[i, 2]-1))); %o A347386 A347386(n) = if(!bitand(n, n-1), 0, 1+A347386(A347385(n))); %Y A347386 Cf. A000265, A001615, A209229, A347385, A347387 (the exponent of the eventual power of 2 reached). %Y A347386 Cf. also A003434, A019269, A227944, A256757, A331410, A336361 for similar sequences. %K A347386 nonn %O A347386 1,5 %A A347386 _Antti Karttunen_, Aug 31 2021