OFFSET
1,5
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Mohammad El-Hindi and Therrar Kadri, On The Generalized Multiplicative Euler Phi Function, arXiv:2111.13474 [math.NT], 2021. Gives a formula.
A. N. El-Kassar and H. Y. Chehade, Generalized Group of Units, Math. Balkanica, Vol. 20 (2006), Fasc. 3-4.
Judy L. Smith and Joseph A. Gallian, Factoring Finite Factor Rings, Mathematics Magazine, 58, (1985), 93-95.
MATHEMATICA
phig[n_Integer, k_Integer]:=phig[n, k]=Module[{f=FactorInteger[n], p, a}, If[k==1, Return[EulerPhi[n]]]; If[n==1, Return[1]]; Times@@Table[{p, a}=f[[j]]; Power@@If[OddQ[p], If[a<k, {phig[p-1, k-1]*Product[phig[p, i], {i, k-a+1, k-1}], 1}, {phig[p-1, k-1]*p^(a-k)*Product[phig[p, i], {i, 1, k-1}], 1}], If[a<2 k, {1, 1}, {2^(a-1), 1}]], {j, Length[f]}]]; a[n_]:=phig[n, 2]; Table[a[n], {n, 1, 80}] (* Vincenzo Librandi, Nov 06 2025 *)
PROG
(PARI) phig(n, k) = {my(f=factor(n)); if (k==1, return(eulerphi(f))); for (j=1, #f~, my(p=f[j, 1], alfa=f[j, 2]); if (p % 2, f[j, 1] = if (alfa < k, phig(p-1, k-1)*prod(i=k-alfa+1, k-1, phig(p, i)), phig(p-1, k-1)*p^(alfa-k)*prod(i=1, k-1, phig(p, i))), f[j, 1] = if (alfa < 2*k, 1, 2^(alfa-1)); ); f[j, 2] = 1; ); factorback(f); }
a(n) = phig(n, 2);
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Michel Marcus, Dec 03 2021
STATUS
approved
