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.

A140397 a(n) = floor(3*phi*n) - 3*floor(phi*n) where phi = (1+sqrt(5))/2.

Original entry on oeis.org

1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 1, 0, 2, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0
Offset: 1

Views

Author

Fred Lunnon, Jun 20 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Floor[3GoldenRatio*n]-3Floor[GoldenRatio*n];Array[a,99] (* James C. McMahon, Jul 08 2025 *)
  • PARI
    a(n) = my(fhi=(1+sqrt(5))/2); floor(3*fhi*n) - 3*floor(fhi*n); \\ Michel Marcus, Aug 26 2013

Formula

a(n) = floor(n*s^2)-floor(s*floor(n*s)), where s=1+phi.