Message Boards Message Boards

0
|
2164 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

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

Posted 4 years ago

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?

POSTED BY: Robert Russell
2 Replies
Posted 4 years ago

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.

POSTED BY: Robert Russell
Posted 4 years ago

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.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract