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”).
%I #16 Sep 08 2022 08:45:09
%S 0,1,3,5,9,14,19,26,34,43,52,63,75,87,101,116,132,148,166,185,204,225,
%T 247,269,293,318,344,370,398,427,456,487,519,552,585,620,656,692,730,
%U 769,808,849,891,934,977,1022,1068,1114,1162,1211,1261,1311,1363,1416
%N a(n) = Sum_{i=1..n} floor(r*floor(i/r)), where r=sqrt(2).
%C 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).
%H G. C. Greubel, <a href="/A081946/b081946.txt">Table of n, a(n) for n = 1..5000</a>
%F a(n) = n*(n+1)/2 - floor((1-1/sqrt(2))*n).
%t Table[Sum[Floor[Sqrt[2] Floor[k/Sqrt[2]]], {k, n}], {n, 50}] (* _G. C. Greubel_, Oct 01 2018 *)
%o (PARI) a(n) = sum(i=1,n,floor(sqrt(2)*floor(i/sqrt(2)))); \\ _Michel Marcus_, Dec 04 2013
%o (Magma) [(&+[Floor(Sqrt(2)*Floor(k/Sqrt(2))): k in [1..n]]): n in [1..50]]; // _G. C. Greubel_, Oct 01 2018
%K nonn
%O 1,3
%A _Benoit Cloitre_, Jun 13 2003