login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051201 Sum of elements of the set { [ n/k ] : 1 <= k <= n }. 9
1, 3, 4, 7, 8, 12, 13, 15, 19, 21, 22, 28, 29, 31, 33, 39, 40, 43, 44, 51, 53, 55, 56, 60, 66, 68, 70, 73, 74, 83, 84, 87, 89, 91, 93, 103, 104, 106, 108, 112, 113, 123, 124, 127, 130, 132, 133, 138, 146, 149, 151, 154, 155, 159, 161, 172, 174, 176, 177, 183, 184, 186 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
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
MATHEMATICA
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]}]];
Array[a, 100] (* Jean-François Alcover, Nov 20 2020, after Max Alekseyev *)
PROG
(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
(Python)
from math import isqrt
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
CROSSREFS
Cf. A006218.
Sequence in context: A078823 A045615 A211220 * A026449 A286904 A282166
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 04:29 EDT 2024. Contains 371782 sequences. (Running on oeis4.)