cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A298369 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) = 1, a(2) = 1.

This page as a plain text file.
%I A298369 #11 Mar 31 2021 19:00:29
%S A298369 1,1,1,7,17,38,87,164,318,576,1040,1773,3134,5241,8877,14728,24579,
%T A298369 40298,66585,108610,178004,289717,472312,766643,1247081,2021980,
%U A298369 3281557,5316888,8619474,13957420,22611507,36603571,59270152,95931095,155290091,251310597
%N A298369 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) = 1, a(2) = 1.
%C A298369 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.
%H A298369 Clark Kimberling, <a href="/A298369/b298369.txt">Table of n, a(n) for n = 0..1000</a>
%t A298369 a[0] = 1; a[1] = 1; a[2] = 1;
%t A298369 a[n_] := a[n] = a[n - 1] + a[n - 2] + Sum[k*a[Floor[n/k]], {k, 2, n}];
%t A298369 Table[a[n], {n, 0, 30}]  (* A298369 *)
%o A298369 (Python)
%o A298369 from functools import lru_cache
%o A298369 @lru_cache(maxsize=None)
%o A298369 def A298369(n):
%o A298369     if n <= 2:
%o A298369         return 1
%o A298369     c, j = A298369(n-1)+A298369(n-2), 2
%o A298369     k1 = n//j
%o A298369     while k1 > 1:
%o A298369         j2 = n//k1 + 1
%o A298369         c += (j2*(j2-1)-j*(j-1))*A298369(k1)//2
%o A298369         j, k1 = j2, n//j2
%o A298369     return c+(n*(n+1)-j*(j-1))//2 # _Chai Wah Wu_, Mar 31 2021
%Y A298369 Cf. A001622, A000045, A298338.
%K A298369 nonn,easy
%O A298369 0,4
%A A298369 _Clark Kimberling_, Feb 10 2018