Talk:Zeckendorf number representation: Difference between revisions

j notes
(j notes)
Line 42:
:By the way, according to your own criteria, the Python solutions are incorrect for 1, since using the 1,1 in the reversed order greedily should produce '10', not '1'. You shouldn't have to special-case 1 like that. --17:59, 11 October 2012 (UTC)
::More to the point, if you don't introduce a special discontinuity like that at 1, then the 1,1 and 1,2 solutions are isomorphic modulo the presence or absence of a trailing 0. Though I should probably not have said "incorrect" above; as Sonia points out, it's ambiguously specified. But I'd very much prefer to disambiguate the rule by saying something like "Using all the numbers in the sequence less than or equal to the number." This is in keeping with the greediness and the reversal of the sequence. Alternately I would not be adverse to going back to a formulation that uses "All the positive Fibonacci numbers in order." That is, the 1,2 solution. Which most of the implementations chose back when it was still unspecified as 1,1... --[[User:TimToady|TimToady]] 18:11, 11 October 2012 (UTC)
== J wiki edit trouble ==
It's supposed to show as
<lang J>
' '&~:Filter@:":@:#:@:#.@:((|. fib 2+i.8) e. fsum)&.>i.3 7
┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐
│0 │1 │10 │100 │101 │1000 │1001 │
├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│1010 │10000 │10001 │10010 │10100 │10101 │100000│
├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│100001│100010│100100│100101│101000│101001│101010│
└──────┴──────┴──────┴──────┴──────┴──────┴──────┘
</lang>
Anonymous user