login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A049829
a(n) = Sum_{k=1..n} T(n,k), array T as in A049828.
3
0, 0, 1, 1, 5, 3, 10, 12, 14, 16, 33, 21, 41, 45, 46, 50, 74, 72, 99, 83, 97, 111, 158, 120, 148, 176, 181, 185, 243, 191, 262, 254, 282, 314, 313, 293, 363, 391, 418, 386, 480, 414, 529, 497, 501, 573, 660, 570, 626, 672, 699, 703
OFFSET
1,5
LINKS
MAPLE
T:= proc(n, k) option remember;
if n*k = 0 then 0 else (n mod k) + procname(k, n mod k) fi
end proc:
seq(add(T(n, k), k=1..n), n=1..100); # Robert Israel, Aug 31 2015
MATHEMATICA
T[n_, k_] := T[n, k] = If[n*k == 0, 0, Mod[n, k] + T[k, Mod[n, k]]];
a[n_] := Sum[T[n, k], {k, 1, n}];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 16 2022, after Robert Israel *)
PROG
(PARI) t(n, k) = {x = n; y = k; r = 1; s = 0; while (r, q = x\y; r = x - y*q; s +=r; x = y; y = r; ); s; }
a(n) = sum(k=1, n, t(n, k)); \\ Michel Marcus, Aug 31 2015
CROSSREFS
Cf. A049828.
Sequence in context: A248660 A141620 A195140 * A258333 A137613 A335302
KEYWORD
nonn
STATUS
approved