I have the following recursive function that involves DivisorSigma
:
r1[n_] := DivisorSigma[1, n];
r2[n_] := Sum[r1[d], {d, Divisors[n]}];
r3[n_] := Sum[r2[d], {d, Divisors[n]}];
...
I would like to implement the generic recursive function r[n_,k_]
where k
is the value of recursion dept parameter, i.e. for k=1
we obtain r1
, for k=2
we obtain r2
and so forth. I came across a relatively new feature called FunctionCompile. I would be very grateful if anyone may help me in implementing this recursive function.
My Background: I am investigating the following identity:
$$r_3(n)=\prod_{p\mid n}(3+p)\quad\text{or generally}\quad r_k(n)=\prod_{p\mid n}(k+p)$$
which is seems to be true at least for $k=2,3$:
p[n_, k_] := Product[p + k, {p, Complement[Divisors[n], {1, n}]}];
Print[r2[10]];
Print[p[10, 2]];
Print[r3[10]];
Print[p[10, 3]];