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.

A364581 Numbers k such that the number of iterations of psi(phi(x)) starting at x = k and terminating when psi(phi(x)) = x (k is counted), -1 otherwise is the same for phi(psi(k)).

This page as a plain text file.
%I A364581 #56 Sep 13 2023 23:12:52
%S A364581 1,4,8,14,15,16,21,22,26,28,32,39,44,45,46,50,51,52,56,58,64,74,82,85,
%T A364581 86,88,92,94,98,100,104,105,111,112,114,116,118,122,128,129,135,142,
%U A364581 146,147,148,153,154,159,164,165,166,172,176,178,182,183,184,186,188
%N A364581 Numbers k such that the number of iterations of psi(phi(x)) starting at x = k and terminating when psi(phi(x)) = x (k is counted), -1 otherwise is the same for phi(psi(k)).
%C A364581 Numbers k such that A364631(k) = A364642(k).
%C A364581 Conjecture: For each a(n), n > 1, a(n)*7 is a term.
%C A364581 Conjecture: For each even a(n), a(n)*2 is a term.
%e A364581 a(1) = 1 is a term because A364631(1) = A364642(1).
%e A364581 a(2) = 4 is a term because A364631(4) = A364642(4).
%e A364581 a(3) = 8 is a term because A364631(8) = A364642(8).
%t A364581 psi[n_] := n*Times @@ (1 + 1/FactorInteger[n][[;; , 1]]); psi[1] = 1; Select[Range[200], Length@ FixedPointList[EulerPhi[psi[#1]] &, #] == Length@ FixedPointList[psi[EulerPhi[#1]] &, #] &] (* _Amiram Eldar_, Aug 04 2023 *)
%o A364581 (Python)
%o A364581 from sympy.ntheory.factor_ import totient
%o A364581 from sympy import isprime, primefactors, prod
%o A364581 def psi(n):
%o A364581     plist = primefactors(n)
%o A364581     return n*prod(p+1 for p in plist)//prod(plist)
%o A364581 def a364631(n):
%o A364581     i = 1
%o A364581     r = n
%o A364581     while (True):
%o A364581         rc = totient(psi(r))
%o A364581         if (rc == r):
%o A364581             break;
%o A364581         r = rc
%o A364581         i += 1
%o A364581     return i
%o A364581 def a364642(n):
%o A364581     i = 1
%o A364581     r = n
%o A364581     while (True):
%o A364581         rc = psi(totient(r))
%o A364581         if (rc == r):
%o A364581             break;
%o A364581         r = rc
%o A364581         i += 1
%o A364581     return i
%o A364581 # Output display terms.
%o A364581 for n in range(1,222):
%o A364581     if(a364631(n) == a364642(n)):
%o A364581         print(n, end = ", ")
%Y A364581 Cf. A000010, A001615, A364631, A364642.
%K A364581 nonn
%O A364581 1,2
%A A364581 _Torlach Rush_, Jul 28 2023