login
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
1, 6, 62, 618, 6180, 61804, 618034, 6180340, 61803399, 618033989, 6180339888, 61803398875, 618033988750, 6180339887499, 61803398874990, 618033988749895, 6180339887498949, 61803398874989485, 618033988749894848, 6180339887498948482, 61803398874989484821
OFFSET
0,2
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.
LINKS
FORMULA
a(n) = A005206(10^n). - Rémy Sigrist, Apr 05 2021
EXAMPLE
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.
MATHEMATICA
set=Nest[Flatten[# /. {1 -> {1, 2}, 2 -> {1}}] &, {1}, 40]; Table[First@Counts@set[[1;; 10^n]], {n, 1, 8}]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Mar 31 2021
EXTENSIONS
a(0) = 1 prepended and more terms from Rémy Sigrist, Apr 05 2021
STATUS
approved