Skip to main content
deleted 250 characters in body
Source Link
TuxCrafting
  • 4.8k
  • 3
  • 33
  • 46

Oasis, 23 bytes

n!

Surprised nobody posted it yet.

Try it online

ExplanationTry it online

n!
n   Push n (The argument)
 !  Push the factorial of the top of the stack
    Implicit outputn*1

For the recursive version, it's 3 bytesExplanation:

n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1

Oasis, 2 bytes

n!

Surprised nobody posted it yet.

Try it online

Explanation

n!
n   Push n (The argument)
 !  Push the factorial of the top of the stack
    Implicit output

For the recursive version, it's 3 bytes:

n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1

Oasis, 3 bytes

Try it online

n*1

Explanation:

n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1
Source Link
TuxCrafting
  • 4.8k
  • 3
  • 33
  • 46

Oasis, 2 bytes

n!

Surprised nobody posted it yet.

Try it online

Explanation

n!
n   Push n (The argument)
 !  Push the factorial of the top of the stack
    Implicit output

For the recursive version, it's 3 bytes:

n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1