Consider $n = p_{1}^{a_1}\cdots p_{r}^{a_{r}}$. An integer $d = p_{i}^{b_{i}} \cdots p_{r}^{b^{r}}$ is called an exponential divisor of $n$ if $b_{i}$ divides $a_{i}$ for every $1\leq i \leq r.$

I am trying to encode two functions: $\tau'(n)$, the number of exponential divisors of $n$, and $\sigma'(n)$, the sum of the exponential divisors of $n$.

Both $\tau'$ and $\sigma'$ are multiplicative, hence we only need to look at them on prime powers. For example

$\sigma'(p^6) = p + p^2 + p^3 + p^6$,


$\tau'(p^6) = 4$.

I have been having difficulty in using Mathematica to encode an expression for $\tau'$ and $\sigma'$. I do not really understand what 'heads' and 'levels' mean. Does anyone have any suggestions?


Here's a fairly straightforward implementation.

sigmaPrime[n_] := Apply[Times, Total[#[[1]]^Divisors[#[[2]]]] & /@ FactorInteger[n]]
tauPrime[n_] := Apply[Times, DivisorSigma[0, #[[2]]] & /@ FactorInteger[n]]

sigmaPrime[2^3 3^2 5^6 7]
(* 13255200 *)

tauPrime[2^3 3^2 5^6 7]
(* 16 *)
sig[n_] := 
 Times @@ MapThread[Total[#1^Divisors[#2]] &, 
tau[n_] := 
 Times @@ MapThread[Length[Divisors[#2]] &, 

These are really trivial variants of MichaelE2 (now that I have read his answer).

Testing (unsuprisingly):

sig[2^3 3^2 5^6 7]


(* 13255200 *)


tau[2^3 3^2 5^6 7]

yields 16.

  • $\begingroup$ Many thanks! These work well. $\endgroup$ – Tim Trudgian Dec 17 '13 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.