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.
1, 6, 62, 618, 6180, 61804, 618034, 6180340, 61803399, 618033989, 6180339888, 61803398875, 618033988750, 6180339887499, 61803398874990, 618033988749895, 6180339887498949, 61803398874989485, 618033988749894848, 6180339887498948482, 61803398874989484821
Offset: 0
Keywords
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.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..1000
- Rémy Sigrist, PARI program for A342959
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
Comments