login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A081946
a(n) = Sum_{i=1..n} floor(r*floor(i/r)), where r=sqrt(2).
1
0, 1, 3, 5, 9, 14, 19, 26, 34, 43, 52, 63, 75, 87, 101, 116, 132, 148, 166, 185, 204, 225, 247, 269, 293, 318, 344, 370, 398, 427, 456, 487, 519, 552, 585, 620, 656, 692, 730, 769, 808, 849, 891, 934, 977, 1022, 1068, 1114, 1162, 1211, 1261, 1311, 1363, 1416
OFFSET
1,3
COMMENTS
More generally if r is irrational 1 < r < 2 then Sum_{i=1..n} floor(r*floor(i/r)) = n*(n+1)/2 - floor((1-1/r)*n); if r > 2, there is the asymptotic formula Sum_{i=1..n} floor(r*floor(i/r)) = n*(n+1)/2 - ceiling(r)*(1-floor(r)/(2*r))*n + O(1).
LINKS
FORMULA
a(n) = n*(n+1)/2 - floor((1-1/sqrt(2))*n).
MATHEMATICA
Table[Sum[Floor[Sqrt[2] Floor[k/Sqrt[2]]], {k, n}], {n, 50}] (* G. C. Greubel, Oct 01 2018 *)
PROG
(PARI) a(n) = sum(i=1, n, floor(sqrt(2)*floor(i/sqrt(2)))); \\ Michel Marcus, Dec 04 2013
(Magma) [(&+[Floor(Sqrt(2)*Floor(k/Sqrt(2))): k in [1..n]]): n in [1..50]]; // G. C. Greubel, Oct 01 2018
CROSSREFS
Sequence in context: A118002 A069533 A054066 * A166709 A310040 A215369
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jun 13 2003
STATUS
approved