OFFSET
0,3
EXAMPLE
a(1) = a(1 mod 1) = a(0) = 1.
a(2) = a(2 mod 1)+a(2 mod 2) = a(0)+a(0) = 2.
a(3) = a(3 mod 1)+a(3 mod 2)+a(3 mod 3) = a(0)+a(1)+a(0) = 3.
MAPLE
a:= proc(n) option remember;
`if`(n=0, 1, add(a(n mod k), k=1..n))
end:
seq(a(n), n=0..62); # Alois P. Heinz, Feb 07 2021
MATHEMATICA
a[0] = 1; a[n_] := a[n] = Sum[a[Mod[n, k]], {k, 1, n}]; Array[a, 50, 0] (* Amiram Eldar, Feb 08 2021 *)
PROG
(Python)
a = [1]
for n in range(1, 1000):
a.append(sum(a[n%k] for k in range(1, n+1)))
(PARI) a(n) = if (n==0, 1, sum(k=1, n, a(n % k))); \\ Michel Marcus, Feb 08 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Rok Cestnik, Feb 07 2021
STATUS
approved