login
A341270
a(n) = Sum_{k=1..n} a(n mod k) for n > 0; a(0) = 1.
0
1, 1, 2, 3, 4, 6, 7, 10, 12, 15, 17, 25, 24, 32, 37, 45, 46, 63, 62, 82, 83, 97, 104, 141, 130, 158, 170, 201, 202, 255, 242, 302, 306, 350, 367, 448, 416, 503, 522, 610, 597, 716, 690, 825, 832, 921, 945, 1147, 1085, 1255, 1272, 1430, 1435, 1683, 1631, 1888
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
For Sum_{k=1..n} n mod k see A004125.
For Sum_{k=1..n} a(k) see A000079.
For Max_{k=1..n} a(n mod k)+1 see A113473.
Sequence in context: A049806 A158381 A163180 * A091515 A036405 A051424
KEYWORD
nonn
AUTHOR
Rok Cestnik, Feb 07 2021
STATUS
approved