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.

A050141 a(n) = 2*floor((n+1)*phi) - 2*floor(n*phi) - 1 where phi = (1 + sqrt(5))/2 is the golden ratio.

Original entry on oeis.org

3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3
Offset: 1

Views

Author

Keywords

Comments

First differences of A050140.
The substitutions 3->1 and 1->0 carry this sequence onto the infinite Fibonacci word (A005614).

Programs

  • Mathematica
    #[[2]]-#[[1]]-1&/@Partition[Table[2*Floor[n*GoldenRatio],{n,100}],2,1] (* Harvey P. Dale, Mar 09 2025 *)
  • PARI
    a(n)=(n+1+sqrtint(5*(n+1)^2))\2*2 - (n+sqrtint(5*n^2))\2*2 - 1 \\ Charles R Greathouse IV, Dec 28 2017
    
  • Python
    from math import isqrt
    def A050141(n): return -(n+isqrt(m:=5*n**2)&-2)+(n+1+isqrt(m+5*((n<<1)+1))&-2)-1
    # Chai Wah Wu, May 04 2025

Extensions

Name edited by Michel Marcus and Charles R Greathouse IV, Dec 28 2017