I'd like to define
sumdiv in Maple such that this:
with(numtheory); f:=x->x^2; sumdiv(f(d)*mobius(100/d), d=1..100);
would do a sum on all divisors
d of $100$.
How to do such a sum over divisors in Maple?
Here's what I've tried:
isdivisible:=(a,b)->if a mod b = 0 then 1 else 0 fi; sum(f(d)*mobius(100/d)*isdivisible(100,d), d=1..100);
but even if
isdivisible(100,d) is $0$ (i.e. $d$ not divisible by $100$), it tries to evaluate
mobius(100/d) anyway which is impossible, thus an error.
Error, (in mobius) invalid arguments