Skip to main content
2 of 2
added 864 characters in body
Neil
  • 177.3k
  • 12
  • 74
  • 281

Charcoal, 11 bytes

≔…·²NθI⁺θΠθ

Try it online! Link is to verbose version of code.

≔…·²Nθ

Create a list from 2 up to n inclusive.

I⁺θΠθ

Vectorised add the list to its product.

Of course, the given formula is just an existence proof and there are usually lower runs. For instance, the LCM is readily proven to produce a run:

Nθ≔…·²θηW⌈﹪±θη≧⁺ιθI⁺θη

Try it online! Link is to verbose version of code. Or more efficiently:

Nθ≔…·²θηFη≔⌊Φ×⊖ηθ¬﹪κιθI⁺θη

Try it online! Link is to verbose version of code.

Neil
  • 177.3k
  • 12
  • 74
  • 281