%I #10 May 30 2022 16:32:49
%S 1,2,21,22,3,31,32,321,322,33,331,332,4,41,42,421,422,43,431,432,4321,
%T 4322,433,4331,4332,44,441,442,4421,4422,443,4431,4432,5,51,52,521,
%U 522,53,531,532,5321,5322,533,5331,5332,54,541,542,5421,5422,543,5431,5432
%N a(n) is the n-th "strange number", where "strange numbers" are defined as follows: using every other Fibonacci number (starting with offset 1), the shortest way to add up these Fibonacci numbers so that the sum equals n, where the digits are indices in the "every other Fibonacci number" sequence.
%C 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.
%C See the Zeckendorf expansion of n (A035517) for a similar expansion. - _N. J. A. Sloane_, Dec 12 2009
%p Contribution from _R. J. Mathar_, Oct 23 2010: (Start)
%p 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:
%p 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:
%p seq(A171549(n),n=1..80) ; (End)
%o (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; }
%K nonn,base
%O 1,2
%A Jonas Hoeglund (firefly(AT)firefly.nu), Dec 11 2009
%E Extended by _R. J. Mathar_, Oct 23 2010