A171549 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.
1, 2, 21, 22, 3, 31, 32, 321, 322, 33, 331, 332, 4, 41, 42, 421, 422, 43, 431, 432, 4321, 4322, 433, 4331, 4332, 44, 441, 442, 4421, 4422, 443, 4431, 4432, 5, 51, 52, 521, 522, 53, 531, 532, 5321, 5322, 533, 5331, 5332, 54, 541, 542, 5421, 5422, 543, 5431, 5432
Offset: 1
Programs
-
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; }
-
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)
Extensions
Extended by R. J. Mathar, Oct 23 2010
Comments