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.

A194735 Number of positive integers k <= n such that {k*sqrt(2)} > {n*sqrt(2)}, where { } = fractional part.

Original entry on oeis.org

0, 0, 2, 1, 4, 2, 0, 5, 2, 8, 4, 0, 8, 3, 12, 6, 16, 9, 2, 14, 6, 19, 10, 1, 16, 6, 22, 11, 28, 16, 4, 23, 10, 30, 16, 2, 24, 9, 32, 16, 0, 25, 8, 34, 16, 43, 24, 5, 34, 14, 44, 23, 2, 34, 12, 45, 22, 56, 32, 8, 44, 19, 56, 30, 4, 43, 16, 56, 28, 0, 42, 13, 56, 26, 70, 39
Offset: 1

Views

Author

Clark Kimberling, Sep 02 2011

Keywords

Crossrefs

Programs

  • Mathematica
    r = Sqrt[2]; p[x_] := FractionalPart[x];
    u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0]
    v[n_, k_] := If[p[k*r] > p[n*r], 1, 0]
    s[n_] := Sum[u[n, k], {k, 1, n}]
    t[n_] := Sum[v[n, k], {k, 1, n}]
    Table[s[n], {n, 1, 100}]   (* A054072 *)
    Table[t[n], {n, 1, 100}]   (* A194735 *)