login
Each Fibonacci number F(n) appears F(n) times.
9

%I #39 Nov 23 2024 16:46:35

%S 1,1,2,2,3,3,3,5,5,5,5,5,8,8,8,8,8,8,8,8,13,13,13,13,13,13,13,13,13,

%T 13,13,13,13,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,

%U 21,21,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34

%N Each Fibonacci number F(n) appears F(n) times.

%C Also n-1-s(n-1), where s(n) is the length of the longest proper suffix of p, the length-n prefix of the infinite Fibonacci word (A003849), that appears twice in p. - _Jeffrey Shallit_, Mar 20 2017

%C a(n+1) = the least period of the length-n prefix of the infinite Fibonacci word (A003849). A period of a length-n word x is an integer p, 1 <= p <= n such that x[i] = x[i+p] for 1 <= i <= n-p. - _Jeffrey Shallit_, May 23 2020

%C a(n) is the largest term in dual Zeckendorf representation of n-1 (A104326), for n >= 2. - _Amiram Eldar_, Aug 09 2024

%F a(n) = A000045(A072649(n)). - _Michel Marcus_, Aug 03 2022

%e As triangle:

%e 1;

%e 1;

%e 2, 2;

%e 3, 3, 3;

%e 5, 5, 5, 5, 5;

%e 8, 8, 8, 8, 8, 8, 8, 8;

%e 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13;

%e ...

%p T:= n-> (f-> f$f)((<<0|1>, <1|1>>^n)[1,2]):

%p seq(T(n), n=1..10); # _Alois P. Heinz_, Nov 23 2024

%t Flatten[Table[#,{#}]&/@Fibonacci[Range[10]]] (* _Harvey P. Dale_, Apr 18 2012 *)

%o (Python)

%o from itertools import islice

%o def A130312_gen(): # generator of terms

%o a, b = 1, 1

%o while True:

%o yield from (a,)*a

%o a, b = b, a+b

%o A130312_list = list(islice(A130312_gen(),20)) # _Chai Wah Wu_, Oct 13 2022

%o (Python)

%o def A130312(n):

%o a, b = 0, 1

%o while (c:=a+b) <= n: a, b = b, c

%o return a # _Chai Wah Wu_, Nov 23 2024

%o (PARI) a(n) = my(m=0); until(fibonacci(m)>n, m++); fibonacci(m-2); \\ _Michel Marcus_, Nov 26 2022

%Y Cf. A000045, A003849, A072649, A104326.

%K nonn,easy,tabf,changed

%O 1,3

%A _Edwin F. Sampang_, May 21 2007

%E More terms from _Harvey P. Dale_, Apr 18 2012