OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
T[n_, k_]:= If[k<=0 || k >= n+1, 0, n + T[k, Mod[n, k]]]; Table[Sum[T[n, k], {k, n}], {n, 30}] (* G. C. Greubel, Aug 07 2019 *)
PROG
(PARI) {T(n, k) = if(k<=0 || k>= n+1, 0, n + T(k, n % k))}; vector(50, n, sum(k=1, n, T(n, k)) ) \\ G. C. Greubel, Aug 07 2019
(Sage)
def T(n, k):
if (k==0): return 0
else: return n + T(n, mod(n, k))
[sum(T(n, k) for k in (1..n)) for n in (1..50)] # G. C. Greubel, Aug 07 2019
(GAP)
T:= function(n, k) if k=0 then return 0;
else return n + T(k, (n mod k));
fi;
end;
List([1..50], n-> Sum([1..n], k-> T(n, k) )); # G. C. Greubel, Aug 07 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved