cp's OEIS Frontend

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.

A156775 Number of iterations of x->(sigma(x)+phi(x))/2 until a non-integer or a previous term is reached, starting with x=n; a(n)=0 if this never happens.

This page as a plain text file.
%I A156775 #15 Jul 23 2024 14:40:15
%S A156775 1,1,1,1,1,2,1,1,1,2,1,2,1,3,2,1,1,1,1,2,3,2,1,4,1,3,2,4,1,3,1,1,4,3,
%T A156775 2,1,1,4,3,2,1,9,1,3,4,2,1,7,1,1,3,2,1,8,3,2,3,2,1,4,1,8,7,1,4,3,1,2,
%U A156775 7,6,1,1,1,4,3,4,6,5,1,2,1,2,1,5,6,5,4,3,1,9,4,3,7,6,5,4,1,1,9,1,1,5,1,9,3
%N A156775 Number of iterations of x->(sigma(x)+phi(x))/2 until a non-integer or a previous term is reached, starting with x=n; a(n)=0 if this never happens.
%C A156775 In [Guy 1997] the iteration is said to fracture when sigma(x)+phi(x) becomes odd. It is not known if a(n)=0 for some n.
%C A156775 A156776(n) gives the number of iterations until the sequence fractures, resp. 0 if this never happens.
%H A156775 Richard K. Guy, <a href="http://www.jstor.org/stable/2974586">Divisors and desires</a>, Amer. Math. Monthly, 104 (1997), 359-360.
%e A156775 Let f(x)=(sigma(x)+phi(x))/2. For x=1 we have f(x) = (1+1)/2 = 1, i.e. after a(1)=1 iterations, the initial term 1 is encountered. For x=2 we have f(x) = (3+1)/2 = 2, so a(2)=1 for the same reason; idem for 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: after a(6)=2 iterations, there's a value already seen before.
%t A156775 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]}, Length[s] - If[s[[-1]] == 0, 2, 1]]; Array[a, 105] (* _Amiram Eldar_, Apr 01 2024 *)
%o A156775 (PARI) A156775(n,u=[])={ until( denominator( n=(sigma(n)+eulerphi(n))/2)>1 || setsearch(u,n), u=setunion(u,Set(n)));#u }
%Y A156775 Cf. A156776, A065387(n) = A000203(n) + A000010(n).
%K A156775 nonn
%O A156775 1,6
%A A156775 _M. F. Hasler_, Feb 15 2009