Skip to main content
Bounty Awarded with 400 reputation awarded by Bubbler
added 47 characters in body
Source Link
user
  • 457
  • 2
  • 21
  • 71

Factor + math.unicode, 30 2929 24 bytes

Saved 1 byte thanks to @Bubbler

  • Saved 1 byte thanks to @Bubbler
  • Saved 5 bytes thanks to @chunes!
[ 1 rot neg <range> productΠ ] 

Try it online!Try it online!

Takes k (which -th factorial) and then n. First we push an n onto the stack, then rot makes the stack look like n 1 k. neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then productΠ finds the product of that range, and that's it.

Factor, 30 29 bytes

Saved 1 byte thanks to @Bubbler

[ 1 rot neg <range> product ] 

Try it online!

Takes k (which -th factorial) and then n. First we push an n onto the stack, then rot makes the stack look like n 1 k. neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then product finds the product of that range, and that's it.

Factor + math.unicode, 30 29 24 bytes

  • Saved 1 byte thanks to @Bubbler
  • Saved 5 bytes thanks to @chunes!
[ 1 rot neg <range> Π ] 

Try it online!

Takes k (which -th factorial) and then n. First we push an n onto the stack, then rot makes the stack look like n 1 k. neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then Π finds the product of that range, and that's it.

added 124 characters in body
Source Link
user
  • 457
  • 2
  • 21
  • 71

Factor, 3030 29 bytes

Saved 1 byte thanks to @Bubbler

[ neg 1 swaprot neg <range> product ] 

Try it online!Try it online!

Takes n and then k (which -th factorial) and then n. First we push an n onto the stack, then rot makes the stack look like n 1 k. neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then product finds the product of that range, and that's it.

Factor, 30 bytes

[ neg 1 swap <range> product ] 

Try it online!

Takes n and then k (which -th factorial). neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then product finds the product of that range, and that's it.

Factor, 30 29 bytes

Saved 1 byte thanks to @Bubbler

[ 1 rot neg <range> product ] 

Try it online!

Takes k (which -th factorial) and then n. First we push an n onto the stack, then rot makes the stack look like n 1 k. neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then product finds the product of that range, and that's it.

Source Link
user
  • 457
  • 2
  • 21
  • 71

Factor, 30 bytes

[ neg 1 swap <range> product ] 

Try it online!

Takes n and then k (which -th factorial). neg negates k, which will act as the step for a range from n to 1 (made using <range>). Then product finds the product of that range, and that's it.