How do I get the variables correct for DivisorSum within DivisorSum?

I can do

DivisorSum[12, DivisorSum[#, # &] &]

without any problem–the answer is 55. But how do I use the divisors of the outer sum in the function for the inner sum? I have no problem with

Qij[p2_] := DivisorSum[p2, MoebiusMu[p2/#] Fij[#] &]/p2;
DivisorSum[per, Qij[#] &]

but if I try to eliminate Qij with

DivisorSum[per,DivisorSum[#, MoebiusMu[#/#1] Fij[#1] &]/#&]

where # is the outer divisor and #1 is the inner divisor, it does not work. Is there a way to distinguish the variables?

Hi Robert,

In some situations it is possible to disambiguate by using parenthesis around # and & to override the default precedence. In other cases Function has to be used.

I tried DivisorSum[per, DivisorSum[#, d1 = #; MoebiusMu[d1/#] Fij[#] &]/# &] and it actually worked, but I don’t understand why it would. I would think that the d1=# should be outside the inner sum, but that does not work.