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.

Showing 1-1 of 1 results.

A194682 Number of k in [1,n] for which + > 1, where < > = fractional part, and r=3-sqrt(2); row sums of A164681.

Original entry on oeis.org

1, 0, 2, 1, 5, 4, 1, 6, 2, 9, 5, 0, 8, 2, 11, 5, 16, 10, 2, 14, 6, 20, 11, 1, 16, 5, 22, 11, 29, 18, 5, 24, 11, 32, 19, 4, 26, 10, 34, 18, 1, 26, 8, 34, 16, 44, 26, 6, 35, 14, 45, 24, 2, 34, 11, 45, 22, 57, 34, 9, 45, 20, 58, 32, 5, 44, 16, 57, 29, 0, 42, 12, 55, 25, 70, 40
Offset: 1

Views

Author

Clark Kimberling, Sep 01 2011

Keywords

Crossrefs

Cf. A194681.

Programs

  • Mathematica
    r = 3 - Sqrt[2]; z = 15;
    p[x_] := FractionalPart[x]; f[x_] := Floor[x];
    w[n_, k_] := p[r^n] + p[r^k] - p[r^n + r^k]
    Flatten[Table[w[n, k], {n, 1, z}, {k, 1, n}]]
      (* A194679 *)
    TableForm[Table[w[n, k], {n, 1, z}, {k, 1, n}]]
    s[n_] := Sum[w[n, k], {k, 1, n}]  (* A194680 *)
    Table[s[n], {n, 1, 100}]
    h[n_, k_] := f[p[n*r] + p[k*r]]
    Flatten[Table[h[n, k], {n, 1, z}, {k, 1, n}]]
      (* A194681 *)
    TableForm[Table[h[n, k], {n, 1, z}, {k, 1, n}]]
    t[n_] := Sum[h[n, k], {k, 1, n}]
    Table[t[n], {n, 1, 100}]   (* A194682 *)
  • PARI
    for(n=1, 50, print1(sum(k=1,n, floor(frac(n*(3-sqrt(2))) + frac(k*(3-sqrt(2))))), ", ")) \\ G. C. Greubel, Feb 08 2018
Showing 1-1 of 1 results.