%I #57 Feb 03 2017 03:58:34
%S 0,0,0,1,3,6,11,17,25,35,47,60,77,95,115,138,164,191,222,254,290,329,
%T 370,412,460,510,562,617,676,736,802,869,940,1014,1090,1169,1255,1342,
%U 1431,1523,1621,1720,1825,1931,2041,2156,2273,2391,2517,2645,2777
%N Total number of counts where floor(N/k) < floor((N+k)/n) for k = {1, 2, ..., n-1} and N >= n.
%H Jon E. Schoenfield, <a href="/A281376/b281376.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..200 from Lorenz H. Menke, Jr.)
%F a(n) = Sum_{d=1..ceiling((n-3)/3)} Sum_{j=1..n-(2*d+1)} floor(j/d). - _Jon E. Schoenfield_, Jan 23 2017
%F a(n) = Sum_{d=1..ceiling(n/3)-1} ((j+1)*(j*d/2 + n mod d)), where j = floor(n/d) - 3. - _Jon E. Schoenfield_, Jan 24 2017
%e For n = 5, we have counted the cases where floor(N/k) < floor((N+k)/5), k = {1,2,3,4} then a(5) = 3, since this is true only for k = 4 and N = 6, k = 4 and N = 7, and k = 4 and N = 11.
%p A281376 := proc(n)
%p local a,k,N;
%p a := 0 ;
%p for k from 1 to n-1 do
%p for N from n do
%p if floor(N/k) < floor((N+k)/n) then
%p a := a +1 ;
%p elif N >= (k+2*n)*k/(n-k) then
%p break;
%p end if;
%p end do:
%p end do:
%p a ;
%p end proc:
%p seq(A281376(n),n=1..10) ; # _R. J. Mathar_, Feb 03 2017
%t a[n_] :=
%t Block[{lhs, rhs, count},
%t count = 0;
%t Do[lhs = Floor[H1/k];
%t rhs = Floor[(H1 + k)/n];
%t If[lhs < rhs, count++], {k, 1, n - 1}, {H1,
%t n, (n^2 - 3 n + 1) + 10}]; (* the 10 is simply guard counts *)
%t Return[count]];
%t a281376[n_] :=
%t Sum[Floor[j/d], {d, Ceiling[(n - 3)/3]}, {j, n - (2 d + 1)}]
%t (* _Hartmut F. W. Hoft_, Jan 25 2017; based on the first formula above *)
%o (PARI) a(n) = sum(d = 1, ceil((n-3)/3), sum(j = 1, n-(2*d+1), j\d)); \\ _Michel Marcus_, Jan 29 2017
%K nonn
%O 1,5
%A _Lorenz H. Menke, Jr._, Jan 20 2017