login
Let f be multiplicative with f(prime(k)^e) = k + e*i for any k, e > 0 (where i denotes the imaginary unit); a(n) is the imaginary part of f(n). See A351464 for the real part.
2

%I #10 Feb 15 2022 21:00:47

%S 0,1,1,2,1,3,1,3,2,4,1,5,1,5,5,4,1,4,1,7,6,6,1,7,2,7,3,9,1,10,1,5,7,8,

%T 7,6,1,9,8,10,1,13,1,11,8,10,1,9,2,5,9,13,1,5,8,13,10,11,1,15,1,12,10,

%U 6,9,16,1,15,11,18,1,8,1,13,7,17,9,19,1,13

%N Let f be multiplicative with f(prime(k)^e) = k + e*i for any k, e > 0 (where i denotes the imaginary unit); a(n) is the imaginary part of f(n). See A351464 for the real part.

%e For n = 42:

%e - 42 = 2 * 3 * 7 = prime(1)^1 * prime(2)^1 * prime(4)^1,

%e - f(42) = (1+i) * (2+i) * (4+i) = 1 + 13*i,

%e - and a(42) = 13.

%p b:= proc(n) option remember; uses numtheory;

%p mul(pi(i[1])+i[2]*I, i=ifactors(n)[2])

%p end:

%p a:= n-> Im(b(n)):

%p seq(a(n), n=1..80); # _Alois P. Heinz_, Feb 15 2022

%t f[p_, e_] := PrimePi[p] + e*I; a[1] = 0; a[n_] := Im[Times @@ f @@@ FactorInteger[n]]; Array[a, 100] (* _Amiram Eldar_, Feb 15 2022 *)

%o (PARI) a(n) = { my (f=factor(n), p=f[,1]~, e=f[,2]~); imag(prod (k=1, #p, primepi(p[k]) + I*e[k])) }

%Y Cf. A289311, A351464, A351475.

%K nonn,easy

%O 1,4

%A _Rémy Sigrist_, Feb 11 2022