OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..3305
FORMULA
a(n+1) = 1 + Sum_{k=1..n} Sum_{d|k} a(d) or a(n+1) = a(n) + Sum_{d|n} a(d). - Vladeta Jovovic, Aug 08 2004
G.f. A(x) satisfies: A(x) = (x/(1 - x)) * (1 + Sum_{k>=1} A(x^k)). - Ilya Gutkovskiy, Feb 25 2020
a(n) ~ c * 2^n, where c = 0.9266495520163897954172886595779644507444342903568129920731434938761... - Vaclav Kotesovec, Dec 26 2023
EXAMPLE
a(3) = 5: 3 = 2+1(1) = 1+2(1) = 1+1(2) = 1+1(1+1(1)).
MAPLE
f:= proc(n) option remember; local d;
procname(n-1) + add(procname(d), d = numtheory:-divisors(n-1))
end proc:
f(1):=1:
map(f, [$1..40]); # Robert Israel, Dec 25 2023
MATHEMATICA
a[1] = 1; a[n_] := a[n] = a[n-1] + DivisorSum[n-1, a[#] &];
Array[a, 50] (* Paolo Xausa, Aug 24 2024 *)
PROG
(PARI) first(upto) = {my(a=vector(upto, i, 1)); for(n=1, upto-1, a[n+1]=a[n]+sumdiv(n, d, a[d])); a} \\ Jason Yuen, Aug 24 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David W. Wilson, Jun 16 2003
STATUS
approved