login
A298370
a(n) = a(n-1) + a(n-2) + 2 a(floor(n/2)) + 3 a(floor(n/3)) + ... + n a(floor(n/n)), where a(0) = 1, a(1) = 2, a(2) = 3.
2
1, 2, 3, 15, 38, 83, 190, 356, 695, 1254, 2267, 3861, 6829, 11417, 19340, 32076, 53545, 87784, 145048, 236589, 387765, 631106, 1028866, 1670013, 2716595, 4404599, 7148426, 11582096, 18776334, 30404300, 49256015, 79735758, 129111774, 208972513, 338277831
OFFSET
0,2
COMMENTS
a(n)/a(n-1) -> (1 + sqrt(5))/2, the golden ratio (A001622), so that (a(n)) has the growth rate of the Fibonacci numbers (A000045). See A298338 for a guide to related sequences.
LINKS
MATHEMATICA
a[0] = 1; a[1] = 2; a[2] = 3;
a[n_] := a[n] = a[n - 1] + a[n - 2] + Sum[k*a[Floor[n/k]], {k, 2, n}];
Table[a[n], {n, 0, 30}] (* A298370 *)
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A298370(n):
if n <= 2:
return n+1
c, j = A298370(n-1)+A298370(n-2), 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2*(j2-1)-j*(j-1))*A298370(k1)//2
j, k1 = j2, n//j2
return c+2*(n*(n+1)-j*(j-1))//2 # Chai Wah Wu, Mar 31 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 10 2018
STATUS
approved