Zeckendorf number representation: Difference between revisions

Line 3,595:
As oneliner.
{{trans|Crystal}}
<lang ruby>def zeckendorfzeckendorf1(n)
0.step.lazy.map { |x| bin = x.to_s(2); bin}.reject{ unless|z| binz.include?("11") }.first(n)
end
 
Anonymous user