Skip to main content
Commonmark migration
Source Link

#NewStack, 14 bytes

NewStack, 14 bytes

N∞ ḟᵢfi 'fif Ṗf⁻

The breakdown:

N∞              Add all natural numbers to the stack
   ḟᵢ           Define new function will value of input
     fi          Get the n'th Fibonacci number for ever element n
       'fif      Remove all elements that don't contain the (input)'th Fibonacci number 
           Ṗf⁻  Print the (input-1)'th element

In English: (with example of an input of 3)

N∞: Make a list of the natural numbers [1,2,3,4,5,6...]

ḟᵢ: Store the input in the variable f [1,2,3,4,5,6...]

: Convert the list to Fibonacci numbers [1,1,2,3,5,8...]

'fif: Keep all elements that contain the fth Fibonacci number [2,21,233...]

Ṗf⁻: Print the f-1th element (-1 due to 0-based indexing) 233

#NewStack, 14 bytes

N∞ ḟᵢfi 'fif Ṗf⁻

The breakdown:

N∞              Add all natural numbers to the stack
   ḟᵢ           Define new function will value of input
     fi          Get the n'th Fibonacci number for ever element n
       'fif      Remove all elements that don't contain the (input)'th Fibonacci number 
           Ṗf⁻  Print the (input-1)'th element

In English: (with example of an input of 3)

N∞: Make a list of the natural numbers [1,2,3,4,5,6...]

ḟᵢ: Store the input in the variable f [1,2,3,4,5,6...]

: Convert the list to Fibonacci numbers [1,1,2,3,5,8...]

'fif: Keep all elements that contain the fth Fibonacci number [2,21,233...]

Ṗf⁻: Print the f-1th element (-1 due to 0-based indexing) 233

NewStack, 14 bytes

N∞ ḟᵢfi 'fif Ṗf⁻

The breakdown:

N∞              Add all natural numbers to the stack
   ḟᵢ           Define new function will value of input
     fi          Get the n'th Fibonacci number for ever element n
       'fif      Remove all elements that don't contain the (input)'th Fibonacci number 
           Ṗf⁻  Print the (input-1)'th element

In English: (with example of an input of 3)

N∞: Make a list of the natural numbers [1,2,3,4,5,6...]

ḟᵢ: Store the input in the variable f [1,2,3,4,5,6...]

: Convert the list to Fibonacci numbers [1,1,2,3,5,8...]

'fif: Keep all elements that contain the fth Fibonacci number [2,21,233...]

Ṗf⁻: Print the f-1th element (-1 due to 0-based indexing) 233

Source Link
Graviton
  • 2.9k
  • 15
  • 32

#NewStack, 14 bytes

N∞ ḟᵢfi 'fif Ṗf⁻

The breakdown:

N∞              Add all natural numbers to the stack
   ḟᵢ           Define new function will value of input
     fi          Get the n'th Fibonacci number for ever element n
       'fif      Remove all elements that don't contain the (input)'th Fibonacci number 
           Ṗf⁻  Print the (input-1)'th element

In English: (with example of an input of 3)

N∞: Make a list of the natural numbers [1,2,3,4,5,6...]

ḟᵢ: Store the input in the variable f [1,2,3,4,5,6...]

: Convert the list to Fibonacci numbers [1,1,2,3,5,8...]

'fif: Keep all elements that contain the fth Fibonacci number [2,21,233...]

Ṗf⁻: Print the f-1th element (-1 due to 0-based indexing) 233