login
A049841
a(n) = Sum_{k=1..n} T(n,k), array T as in A049840.
2
1, 4, 11, 19, 36, 45, 74, 92, 119, 144, 199, 203, 276, 307, 346, 394, 483, 504, 613, 621, 704, 785, 918, 896, 1033, 1128, 1207, 1271, 1462, 1421, 1658, 1694, 1827, 1966, 2051, 2087, 2362, 2465, 2594, 2626, 2941, 2886, 3239
OFFSET
1,2
LINKS
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
Cf. A049840.
Sequence in context: A016437 A102788 A016433 * A339370 A038439 A038431
KEYWORD
nonn
STATUS
approved