OFFSET
1,2
COMMENTS
We can also find these numbers as follows: We have an alphabet {1, 2, 3, 4, 5, ...}, and a number known as the "limit", initially set to 1. to describe the first number, we use the first character of the alphabet: 1 to describe 2, we have to increase the limit and define a new character: 2 to describe 3, the limit is now 2, so we may use two characters. 2+1 = 3, therefore: 21 to describe 4, we use 22 to describe 5, we need a new character: 3. the limit is now increased to 3. etc.
See the Zeckendorf expansion of n (A035517) for a similar expansion. - N. J. A. Sloane, Dec 12 2009
MAPLE
Contribution from R. J. Mathar, Oct 23 2010: (Start)
read("transforms") ; A130234 := proc(n) local m, N, a, i ; for m from 0 do if combinat[fibonacci](m) >= n then break ; end if; end do; m ; end proc:
A171549 := proc(n) local m, N, a, i ; m := A130234(n) ; if type(m, 'odd') then m := m+1 ; end if; N := n ; a := 0 ; while N >0 do for i from m to 1 by -1 do if N >= combinat[fibonacci](2*i-1) then N := N- combinat[fibonacci](2*i-1) ; a := digcat2(a, i) ; break ; end if; end do: end do: return a; end proc:
seq(A171549(n), n=1..80) ; (End)
PROG
(Java) // fib(n) gives fibonacci number n. public static String S(int n) { int max; for (max = 0; fib(max) < n; max += 2); int num = n; String out = ""; while (num > 0) { for (int i = max; i>0; i--) if (num >= fib(2*i-1)) { num -= fib(2*i-1); out += (char)('0' + i); break; } } return out; }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jonas Hoeglund (firefly(AT)firefly.nu), Dec 11 2009
EXTENSIONS
Extended by R. J. Mathar, Oct 23 2010
STATUS
approved