%I #9 Mar 31 2023 06:56:52
%S 1,1,2,2,2,2,2,2,2,2,2,4,2,2,4,2,2,2,2,4,4,2,2,4,2,2,4,4,2,4,2,2,4,2,
%T 4,4,2,2,4,4,2,4,2,4,4,2,2,4,2,2,4,4,2,4,4,4,4,2,2,8,2,2,4,4,4,4,2,4,
%U 4,4,2,4,2,2,4,4,4,4,2,4,2,2,2,7,4,2,4
%N Number of distinct values obtained when the infinitary totient function (A091732) is applied to the infinitary divisors of n.
%C First differs from A348001 at n = 27.
%H Amiram Eldar, <a href="/A361923/b361923.txt">Table of n, a(n) for n = 1..10000</a>
%t f[p_, e_] := p^(2^(-1 + Position[Reverse@ IntegerDigits[e, 2], 1]));
%t iphi[1] = 1; iphi[n_] := Times @@ (Flatten@ (f @@@ FactorInteger[n]) - 1);
%t idivs[n_] := Sort@ Flatten@ Outer[Times, Sequence @@ (FactorInteger[n] /. {p_, m_Integer} :> p^Select[Range[0, m], BitOr[m, #] == m &])]; idivs[1] = {1};
%t a[n_] := Length @ Union[iphi /@ idivs[n]]; Array[a, 100]
%o (PARI) iphi(n) = {my(f=factor(n), b); prod(i=1, #f~, b = binary(f[i, 2]); prod(k=1, #b, if(b[k], f[i, 1]^(2^(#b-k)) - 1, 1)))}
%o isidiv(d, f) = {if (d==1, return (1)); for (k=1, #f~, bne = binary(f[k, 2]); bde = binary(valuation(d, f[k, 1])); if (#bde < #bne, bde = concat(vector(#bne-#bde), bde)); for (j=1, #bne, if (! bne[j] && bde[j], return (0)); ); ); return (1); }
%o idivs(n) = {my(d = divisors(n), f = factor(n), idiv = []); for (k=1, #d, if(isidiv(d[k], f), idiv = concat(idiv, d[k])); ); idiv; } \\ _Michel Marcus_ at A077609
%o a(n) = {my(d = idivs(n)); #Set(apply(x->iphi(x), d));}
%Y Cf. A077609, A091732.
%Y Similar sequences: A319696, A348001.
%K nonn
%O 1,3
%A _Amiram Eldar_, Mar 30 2023