|
|
A281376
|
|
Total number of counts where floor(N/k) < floor((N+k)/n) for k = {1, 2, ..., n-1} and N >= n.
|
|
1
|
|
|
0, 0, 0, 1, 3, 6, 11, 17, 25, 35, 47, 60, 77, 95, 115, 138, 164, 191, 222, 254, 290, 329, 370, 412, 460, 510, 562, 617, 676, 736, 802, 869, 940, 1014, 1090, 1169, 1255, 1342, 1431, 1523, 1621, 1720, 1825, 1931, 2041, 2156, 2273, 2391, 2517, 2645, 2777
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,5
|
|
LINKS
|
|
|
FORMULA
|
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
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
|
|
EXAMPLE
|
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.
|
|
MAPLE
|
local a, k, N;
a := 0 ;
for k from 1 to n-1 do
for N from n do
if floor(N/k) < floor((N+k)/n) then
a := a +1 ;
elif N >= (k+2*n)*k/(n-k) then
break;
end if;
end do:
end do:
a ;
end proc:
|
|
MATHEMATICA
|
a[n_] :=
Block[{lhs, rhs, count},
count = 0;
Do[lhs = Floor[H1/k];
rhs = Floor[(H1 + k)/n];
If[lhs < rhs, count++], {k, 1, n - 1}, {H1,
n, (n^2 - 3 n + 1) + 10}]; (* the 10 is simply guard counts *)
Return[count]];
a281376[n_] :=
Sum[Floor[j/d], {d, Ceiling[(n - 3)/3]}, {j, n - (2 d + 1)}]
|
|
PROG
|
(PARI) a(n) = sum(d = 1, ceil((n-3)/3), sum(j = 1, n-(2*d+1), j\d)); \\ Michel Marcus, Jan 29 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|