Skip to main content
added 40 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

Neat solutions provided, but there are probably more straight forward ways to solve the original problem. One of these might help.

In:= s=0; Apply[Do[s+=i^i,{i,##}]&,Hold[1,12,3]]; s

Out[75]= 10000823800

In:= r=Hold[s=0;{1,12,3};s];
Part[r,1,2,0]=(Do[s+=i^i,{i,##}]&); ReleaseHold[r]

Out= 10000823800

In:= s=0; Apply[Do[s+=i^i,{i,##}]&,Hold[1,12,3]]; s Out[75]= 10000823800 In:= r=Hold[s=0;{1,12,3};s]; Part[r,1,2,0]=(Do[s+=i^i,{i,##}]&); ReleaseHold[r] Out= 10000823800 

Neat solutions provided, but there are probably more straight forward ways to solve the original problem. One of these might help.

In:= s=0; Apply[Do[s+=i^i,{i,##}]&,Hold[1,12,3]]; s

Out[75]= 10000823800

In:= r=Hold[s=0;{1,12,3};s];
Part[r,1,2,0]=(Do[s+=i^i,{i,##}]&); ReleaseHold[r]

Out= 10000823800

Neat solutions provided, but there are probably more straight forward ways to solve the original problem. One of these might help.

In:= s=0; Apply[Do[s+=i^i,{i,##}]&,Hold[1,12,3]]; s Out[75]= 10000823800 In:= r=Hold[s=0;{1,12,3};s]; Part[r,1,2,0]=(Do[s+=i^i,{i,##}]&); ReleaseHold[r] Out= 10000823800 
Source Link
Ted Ersek
  • 7.2k
  • 20
  • 42

Neat solutions provided, but there are probably more straight forward ways to solve the original problem. One of these might help.

In:= s=0; Apply[Do[s+=i^i,{i,##}]&,Hold[1,12,3]]; s

Out[75]= 10000823800

In:= r=Hold[s=0;{1,12,3};s];
Part[r,1,2,0]=(Do[s+=i^i,{i,##}]&); ReleaseHold[r]

Out= 10000823800