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.

A342959 Number of 1's within a sample word of length 10^n of the infinite Fibonacci word A003842 where n is the sequence index.

Original entry on oeis.org

1, 6, 62, 618, 6180, 61804, 618034, 6180340, 61803399, 618033989, 6180339888, 61803398875, 618033988750, 6180339887499, 61803398874990, 618033988749895, 6180339887498949, 61803398874989485, 618033988749894848, 6180339887498948482, 61803398874989484821
Offset: 0

Views

Author

Frank M Jackson, Mar 31 2021

Keywords

Comments

The proportion of 1's within the sample word length tends to 1/phi = 0.6180339887... (A094214) as the sample size increases to infinity.

Examples

			a(1) = 6 because the first sample of the infinite Fibonacci word has a word length of 10. The word sample is (1, 2, 1, 1, 2, 1, 2, 1, 1, 2) and #1's = 6.
		

Crossrefs

Programs

  • Mathematica
    set=Nest[Flatten[# /. {1 -> {1, 2}, 2 -> {1}}] &, {1}, 40]; Table[First@Counts@set[[1;;10^n]], {n, 1, 8}]
  • PARI
    See Links section.
    
  • PARI
    my(s=quadgen(5)-1); a(n) = floor((10^n+1)*s); \\ Kevin Ryde, Apr 09 2021
    
  • Python
    from math import isqrt
    def A342959(n): return ((m:=10**n+1)+isqrt(5*m**2)>>1)-m # Chai Wah Wu, Aug 09 2022

Formula

a(n) = A005206(10^n). - Rémy Sigrist, Apr 05 2021

Extensions

a(0) = 1 prepended and more terms from Rémy Sigrist, Apr 05 2021