Makowski proved that phi(n) + sigma(n) = nd(n) if and only if n is a prime (see in Sivaramakrishnan, Chapter I, page 8, Theorem 3). In more special cases, k differs from n and phi(n) + sigma(n) is divisible by higher powers of the number of divisors.