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 A156776 #15 Jul 23 2024 14:39:55 %S A156776 0,0,0,1,0,0,0,1,1,0,0,2,0,3,2,1,0,1,0,2,0,0,0,4,1,0,0,4,0,0,0,1,4,3, %T A156776 2,1,0,0,0,0,0,9,0,0,0,0,0,7,1,1,0,0,0,8,3,2,0,0,0,0,0,8,7,1,0,0,0,0, %U A156776 7,6,0,1,0,0,0,4,6,5,0,0,1,0,0,5,6,5,4,3,0,9,0,0,7,6,5,4,0,1,9,1,0,5,0,9,3 %N A156776 Number of iterations of x->(sigma(x)+phi(x))/2 until a non-integer is reached when starting with x=n; a(n)=0 if this never happens. %C A156776 In [Guy 1997] the iteration is said to fracture when sigma(x)+phi(x) becomes odd. For n with a(n)=0, A156775(n) gives the number of iterations until a previously seen term is encountered. %H A156776 Richard K. Guy, <a href="https://www.jstor.org/stable/2974586">Divisors and desires</a>, Amer. Math. Monthly, 104 (1997), 359-360. %e A156776 Let f(x)=(sigma(x)+phi(x))/2. For x=1 we have f(x) = (1+1)/2 = 1, i.e. this is a fixed point and the sequence will never fraction, hence a(1)=0. The same happens for x=2, x=3 and x=5. For x=4 we have f(x) = (7+2)/2 = 9/2, the sequence "fractures" after a(4)=1 iterations. For x=6 we have f(x) = (12+2)/2 = 7, f(7) = (8+6)/2 = 7, a fixed point, so again a(6)=a(7)=0. %t A156776 f[n_] := If[IntegerQ[n], n, 0]; g[n_] := f[(DivisorSigma[1, n] + EulerPhi[n])/2]; a[n_] := Module[{s = NestWhileList[g, n, UnsameQ, All]}, If[s[[-1]] == 0, Length[s] - 2, 0]]; Array[a, 105] (* _Amiram Eldar_, Apr 01 2024 *) %o A156776 (PARI) A156776(n,u=[])={ until( denominator( n=(sigma(n)+eulerphi(n))/2)>1 || setsearch(u,n), u=setunion(u,Set(n))); if( denominator(n)>1, #u) } %Y A156776 Cf. A156775, A065387(n) = A000203(n) + A000010(n). %K A156776 nonn %O A156776 1,12 %A A156776 _M. F. Hasler_, Feb 15 2009