Skip to main content
added 11 characters in body
Source Link
Uriel
  • 13.3k
  • 4
  • 18
  • 45

Dyalog APL, 28 bytes

{x/⍨⍵≥x←⌽{1∧+∘÷/0,⍵/1}¨⍳2+⍵¨⍳2×⍵} 

Requires ⎕IO←0.

Try it online!Try it online!

How?

{1∧+∘÷/0,⍵/1} - apply fibonacci

    ¨⍳2+⍵¨⍳2×⍵ - to the range 00 ..n+1 2n

x←⌽ - reverse and assign to x

x/⍨ - filter x with

    ⍵≥x - the function x <= n

Dyalog APL, 28 bytes

{x/⍨⍵≥x←⌽{1∧+∘÷/0,⍵/1}¨⍳2+⍵} 

Requires ⎕IO←0.

Try it online!

How?

{1∧+∘÷/0,⍵/1} - apply fibonacci

    ¨⍳2+⍵ - to the range 0..n+1

x←⌽ - reverse and assign to x

x/⍨ - filter x with

    ⍵≥x - the function x <= n

Dyalog APL, 28 bytes

{x/⍨⍵≥x←⌽{1∧+∘÷/0,⍵/1}¨⍳2×⍵} 

Requires ⎕IO←0.

Try it online!

How?

{1∧+∘÷/0,⍵/1} - apply fibonacci

    ¨⍳2×⍵ - to the range 0 .. 2n

x←⌽ - reverse and assign to x

x/⍨ - filter x with

    ⍵≥x - the function x <= n

Source Link
Uriel
  • 13.3k
  • 4
  • 18
  • 45

Dyalog APL, 28 bytes

{x/⍨⍵≥x←⌽{1∧+∘÷/0,⍵/1}¨⍳2+⍵} 

Requires ⎕IO←0.

Try it online!

How?

{1∧+∘÷/0,⍵/1} - apply fibonacci

    ¨⍳2+⍵ - to the range 0..n+1

x←⌽ - reverse and assign to x

x/⍨ - filter x with

    ⍵≥x - the function x <= n