Skip to main content
added 61 characters in body
Source Link
Roman
  • 2k
  • 8
  • 17

Wolfram Language (Mathematica), 2222 21 bytes

Times@@Range[#1##&@@Range[#,1,-#2]&

Try it online!Try it online!

-1 thanks to attinat: Times --> 1##&

Explanation: use Range to make a list of the values {n, n-k, n-2k, n-3k, ...}, stopping before going below 1 (i.e., stopping just right). Then multiply all numbers in this list with Times (or 1##&).

Wolfram Language (Mathematica), 22 bytes

Times@@Range[#,1,-#2]&

Try it online!

Explanation: use Range to make a list of the values {n, n-k, n-2k, n-3k, ...}, stopping before going below 1 (i.e., stopping just right). Then multiply all numbers in this list with Times.

Wolfram Language (Mathematica), 22 21 bytes

1##&@@Range[#,1,-#2]&

Try it online!

-1 thanks to attinat: Times --> 1##&

Explanation: use Range to make a list of the values {n, n-k, n-2k, n-3k, ...}, stopping before going below 1 (i.e., stopping just right). Then multiply all numbers in this list with Times (or 1##&).

Source Link
Roman
  • 2k
  • 8
  • 17

Wolfram Language (Mathematica), 22 bytes

Times@@Range[#,1,-#2]&

Try it online!

Explanation: use Range to make a list of the values {n, n-k, n-2k, n-3k, ...}, stopping before going below 1 (i.e., stopping just right). Then multiply all numbers in this list with Times.