|
|
A139764
|
|
Smallest term in Zeckendorf representation of n.
|
|
11
|
|
|
1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 21, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 34, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 55, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 21, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 89
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Also called a "Fibonacci fractal".
Appears to be the same as the "ruler of Fibonaccis" mentioned by Knuth. - N. J. A. Sloane, Aug 03 2012
a(n) is also the number of matches to take away to win in a certain match game (see Rocher et al.).
The frequencies of occurrences of the values in this sequence and A035614 are related by the golden ratio.
|
|
REFERENCES
|
D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 82, solution to Problem 179. - From N. J. A. Sloane, Aug 03 2012
|
|
LINKS
|
A. J. Schwenk, Take-Away Games, The Fibonacci Quarterly, v 8, no 3 (1970), 225-234.
|
|
FORMULA
|
a(n) = n if n is a Fibonacci number, else a( n - (largest Fibonacci number < n) ).
a(n) = the value of the (exactly one) digit that turns on between the Fibonacci-base representations of n-1 and n. E.g., from 6 (1001) to 7 (1010), the two's digit turns on.
a(n) = top element of the column of the Wythoff array that contains n.
|
|
EXAMPLE
|
The Zeckendorf representation of 7 = 5 + 2, so a(7) = 2.
|
|
MAPLE
|
A000045 := proc(n) combinat[fibonacci](n) ; end:
local a, i ;
a := 0 ;
for i from 0 do
else
RETURN(a) ;
fi ;
od:
end:
local nResid, prevF ;
nResid := n ;
while true do
if prevF = nResid then
RETURN(prevF) ;
else
nResid := nResid-prevF ;
fi ;
od:
end:
|
|
MATHEMATICA
|
f[n_] := (k = 1; ff = {}; While[(fi = Fibonacci[k]) <= n, AppendTo[ff, fi]; k++]; Drop[ff, 1]); a[n_] := First[ If[n == 0, 0, r = n; s = {}; fr = f[n]; While[r > 0, lf = Last[fr]; If[lf <= r, r = r - lf; PrependTo[s, lf]]; fr = Drop[fr, -1]]; s]]; Table[a[n], {n, 1, 89}] (* Jean-François Alcover, Nov 02 2011 *)
|
|
PROG
|
(PARI) a(n)=my(f); forstep(k=log(n*sqrt(5))\log(1.61803)+2, 2, -1, f=fibonacci(k); if(f<=n, n-=f; if(!n, return(f)); k--)) \\ Charles R Greathouse IV, Nov 02 2011
(Haskell)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice
|
|
AUTHOR
|
Steve Witham (sw(AT)tiac.net), May 15 2008
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|