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.

A051201 Sum of elements of the set { [ n/k ] : 1 <= k <= n }.

This page as a plain text file.
%I A051201 #29 Nov 19 2024 00:47:40
%S A051201 1,3,4,7,8,12,13,15,19,21,22,28,29,31,33,39,40,43,44,51,53,55,56,60,
%T A051201 66,68,70,73,74,83,84,87,89,91,93,103,104,106,108,112,113,123,124,127,
%U A051201 130,132,133,138,146,149,151,154,155,159,161,172,174,176,177,183,184,186
%N A051201 Sum of elements of the set { [ n/k ] : 1 <= k <= n }.
%H A051201 Alois P. Heinz, <a href="/A051201/b051201.txt">Table of n, a(n) for n = 1..10000</a>
%F A051201 a(n) = m*(m+1)/2 + Sum_{k=1..floor(n/(m+1))} floor(n/k), where m is the largest number such that m*(m+1) <= n, i.e., m=floor((sqrt(4*n+1)-1)/2 ). - _Max Alekseyev_, Feb 12 2012
%F A051201 From _Ridouane Oudra_, Nov 02 2024: (Start)
%F A051201 a(n) = r*(r-1)/2 + Sum_{k=1..floor(sqrt(n))} floor(n/k), where r = floor(sqrt(n+1) + 1/2).
%F A051201 a(n) = (1/4)*t*(t-1) + (1/2)*Sum_{k=1..n} floor(n/k), where t = floor(sqrt(4*n + 1)).
%F A051201 a(n) = (1/4)*A000267(n)*A055086(n) + (1/2)*A006218(n). (End)
%p A051201 seq(add(j, j in {seq(floor(n/i), i=1..n)}), n=1..100); # _Ridouane Oudra_, Nov 02 2024
%t A051201 a[n_] := With[{m = Quotient[Floor@Sqrt[4n+1]-1, 2]}, m(m+1)/2 + Sum[ Quotient[n, k], {k, 1, Quotient[n, m+1]}]];
%t A051201 Array[a, 100] (* _Jean-François Alcover_, Nov 20 2020, after _Max Alekseyev_ *)
%o A051201 (PARI) { a(n) = m=(sqrtint(4*n+1)-1)\2; m*(m+1)/2 + sum(k=1,n\(m+1),n\k) } \\ _Max Alekseyev_, Feb 12 2012
%o A051201 (Python)
%o A051201 from math import isqrt
%o A051201 def A051201(n): return ((m:=isqrt((n<<2)+1)+1>>1)*(m-1)>>1)+sum(n//k for k in range(1,n//m+1)) # _Chai Wah Wu_, Oct 31 2023
%Y A051201 Cf. A006218, A000267, A055086.
%K A051201 nonn
%O A051201 1,2
%A A051201 _David W. Wilson_