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.

A348213 a(n) is the number of iterations that n requires to reach a fixed point under the map x -> A348158(x).

This page as a plain text file.
%I A348213 #15 Nov 15 2021 11:10:04
%S A348213 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
%T A348213 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,2,0,1,0,1,
%U A348213 0,1,0,1,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0
%N A348213 a(n) is the number of iterations that n requires to reach a fixed point under the map x -> A348158(x).
%C A348213 a(n) first differs from 1-A000035(n) at n = 63.
%C A348213 The number of iterations is finite for all n since A348158(n) <= n.
%C A348213 The fixed points are terms of A326835, so a(n) = 0 if and only if n is a term of A326835.
%H A348213 Amiram Eldar, <a href="/A348213/b348213.txt">Table of n, a(n) for n = 1..10000</a>
%e A348213 a(1) = 0 since 1 is in A326835.
%e A348213 a(2) = 1 since there is one iteration of the map x -> A348158(x) starting from 2: 2 -> 1.
%e A348213 a(64) = 2 since there are 2 iterations of the map x -> A348158(x) starting from 64: 64 -> 63 -> 57.
%t A348213 f[n_] := Plus @@ DeleteDuplicates @ Map[EulerPhi, Divisors[n]]; a[n_] := -2 + Length @ FixedPointList[f, n]; Array[a, 100]
%o A348213 (Python)
%o A348213 from sympy import totient, divisors
%o A348213 def A348213(n):
%o A348213     c, k = 0, n
%o A348213     m = sum(set(map(totient,divisors(k,generator=True))))
%o A348213     while m != k:
%o A348213         k = m
%o A348213         m = sum(set(map(totient,divisors(k,generator=True))))
%o A348213         c += 1
%o A348213     return c # _Chai Wah Wu_, Nov 15 2021
%Y A348213 Cf. A000035, A003434, A326835, A348158.
%K A348213 nonn
%O A348213 1,64
%A A348213 _Amiram Eldar_, Oct 07 2021