Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Jun 15 2022 14:35:58
%S 1,1,1,1,1,1,1,1,1,1,1,1,1,3,2,1,1,1,1,1,2,1,1,1,1,3,1,1,1,2,1,1,2,1,
%T 2,1,1,3,2,1,1,6,1,1,4,1,1,1,1,3,2,1,1,1,2,3,2,1,1,2,1,3,2,1,4,2,1,1,
%U 2,6,1,1,1,3,2,1,2,6,1,1,1,1,1,2,4,3,2,5,1,4,6,1,2,1,2,1,1,3,2,1,1,2,1,3,4
%N a(n) = A344875(n) / A344878(n), where A344875(n) is multiplicative with a(2^e) = 2^(1+e) - 1, and a(p^e) = p^e -1 for odd primes p, and A344878(n) gives the least common multiple of the same factors.
%H Antti Karttunen, <a href="/A344879/b344879.txt">Table of n, a(n) for n = 1..65537</a>
%t f[2, e_] := 2^(e + 1) - 1; f[p_, e_] := p^e - 1; a[1] = 1; a[n_] := Times @@ (fct = f @@@ FactorInteger[n])/LCM @@ fct; Array[a, 100] (* _Amiram Eldar_, Jun 03 2021 *)
%o (PARI)
%o A344875(n) = { my(f=factor(n)~); prod(i=1, #f, (f[1, i]^(f[2, i]+(2==f[1, i]))-1)); };
%o A344878(n) = if(1==n,n, my(f=factor(n)~); lcm(vector(#f, i, (f[1, i]^(f[2, i]+(2==f[1, i]))-1))));
%o A344879(n) = (A344875(n) / A344878(n));
%o (Python)
%o from math import prod, lcm
%o from sympy import factorint
%o def A344879(n): return prod(a := tuple(p**(e+int(p==2))-1 for p, e in factorint(n).items()))//lcm(*a) # _Chai Wah Wu_, Jun 15 2022
%Y Cf. A344875, A344878.
%K nonn
%O 1,14
%A _Antti Karttunen_, Jun 03 2021