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.

A194397 Numbers m such that Sum_{k=1..m} (<1/2 + k*r> - ) > 0, where r=sqrt(14) and < > denotes fractional part.

Original entry on oeis.org

3, 7, 11, 15, 19, 23, 27, 61, 65, 69, 73, 77, 81, 85, 89, 91, 92, 93, 95, 96, 97, 99, 100, 101, 103, 104, 105, 107, 108, 109, 111, 112, 113, 115, 116, 117, 119, 123, 127, 131, 135, 139, 143, 147, 181, 185, 189, 193, 197, 201, 205, 209, 211, 212, 213, 215
Offset: 1

Views

Author

Clark Kimberling, Aug 23 2011

Keywords

Comments

See A194368.

Crossrefs

Cf. A010471 (sqrt(14)), A194368, A194396, A194397.

Programs

  • Maple
    r:= sqrt(14):
    X:= 0: R:= NULL: count:= 0:
    for n from 1 while count < 100 do
      X:= X + frac(1/2+n*r) - frac(n*r);
      if X > 0 then
        count:= count+1;
        R:= R, n
      fi
    od:
    R; # Robert Israel, Nov 25 2020
  • Mathematica
    r = Sqrt[14]; c = 1/2;
    x[n_] := Sum[FractionalPart[k*r], {k, 1, n}]
    y[n_] := Sum[FractionalPart[c + k*r], {k, 1, n}]
    t1 = Table[If[y[n] < x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t1, 1]]       (* A194395 *)
    t2 = Table[If[y[n] == x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t2, 1]]       (* A194396 *)
    t3 = Table[If[y[n] > x[n], 1, 0], {n, 1, 300}];
    Flatten[Position[t3, 1]]       (* A194397 *)