cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A281376 Total number of counts where floor(N/k) < floor((N+k)/n) for k = {1, 2, ..., n-1} and N >= n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Lorenz H. Menke, Jr., Jan 20 2017

Keywords

Examples

			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.
		

Programs

  • Maple
    A281376 := proc(n)
        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:
    seq(A281376(n),n=1..10) ; # R. J. Mathar, Feb 03 2017
  • 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)}]
    (* Hartmut F. W. Hoft, Jan 25 2017; based on the first formula above *)
  • PARI
    a(n) = sum(d = 1, ceil((n-3)/3), sum(j = 1, n-(2*d+1), j\d)); \\ Michel Marcus, Jan 29 2017

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