|
|
A006586
|
|
a(n) = Sum_{k=1..n} floor((2n-1)/(2k+1)).
(Formerly M0988)
|
|
0
|
|
|
1, 2, 4, 6, 8, 10, 14, 15, 18, 22, 24, 27, 31, 33, 37, 40, 44, 47, 51, 53, 57, 63, 65, 68, 73, 75, 81, 85, 87, 91, 97, 100, 104, 108, 112, 115, 121, 125, 129, 134, 136, 142, 146, 148, 156, 160, 164, 166, 173, 176, 180, 188, 190, 194, 200, 202, 208, 214, 218, 223, 227
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,2
|
|
COMMENTS
|
"Nearest integer to" rounds down rather than up when given an exact half-integer.
Can also be described as sum_{k=1..n-1} { nearest integer to (n-k)/k }. - Jackson Xier, Oct 04 2011
|
|
REFERENCES
|
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
|
|
FORMULA
|
Clearly a(n) = n log n + O(n); a better estimate is surely possible.
|
|
EXAMPLE
|
Row sums of the triangle with entries floor((2n-1)/(2k+1)):
0;
1,0;
1,1,0;
2,1,1,0;
3,1,1,1,0;
3,2,1,1,1,0;
4,2,1,1,1,1,0;
5,3,2,1,1,1,1,0;
5,3,2,1,1,1,1,1,0;
6,3,2,2,1,1,1,1,1,0;
7,4,3,2,1,1,1,1,1,1,0;
|
|
MAPLE
|
N:=proc(x) local t1; t1:=floor(x); if x-t1 = 1/2 then t1 else floor(x+1/2); fi; end;
f:=n->add(N((n-k)/k), k=1..n-1);
[seq(f(n), n=1..120)];
|
|
MATHEMATICA
|
Sum[Floor[(-1 + 2 n)/(1 + 2 k)], {k, 1, n}] (* Jackson Xier, Oct 04 2011 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More terms from Gareth McCaughan (gareth.mccaughan(AT)pobox.com), Jun 10 2004
|
|
STATUS
|
approved
|
|
|
|