OFFSET
1,1
COMMENTS
The Zeckendorf representation of an integer n expresses n as a sum of non-adjacent Fibonacci numbers. It can be expressed as a word over {0,1} giving the coefficients, starting with the most significant digit.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
The representation of 7 is 1010, which is of the form ww with w = 10.
MAPLE
F:= [seq(combinat:-fibonacci(i), i=2..21)]:
ext:= proc(L)
if L[2] = 0 then [0, op(L)], [0, 1, op(L[2..-1])]
else [0, op(L)]
fi
end proc:
build:= proc(L) local i, k;
k:= nops(L);
add((F[i]+F[k+i])*L[i], i=1..k)
end proc:
R[2]:= [[0, 1]]:
for i from 3 to 10 do R[i]:= map(ext, R[i-1]) od:
map(build, [seq(op(R[i]), i=2..10)]); # Robert Israel, Feb 19 2019
MATHEMATICA
Reap[Do[ w = IntegerDigits[k, 2]; p = 1 + Flatten@ Position[ Reverse@ Join[w, w], 1]; If[ Min@ Differences@ p > 1, Sow@ Total@ Fibonacci@ p], {k, 2^10 - 1}]][[2, 1]] (* Giovanni Resta, May 13 2017 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, May 13 2017
STATUS
approved