Skip to main content
added 66 characters in body
Source Link
Gábor Fekete
  • 3.5k
  • 1
  • 9
  • 19

Python 3.8 (pre-release), 6969 62 bytes

lambda n:(r:=range(2,n+1),[math[i-~math.prodfactorial(rn)+i for i in r]range(1,n)[1]]
import math

Try it online!Try it online!

Edit: changed math.prod to math.factorial, thanks to @l4m2

Python 3.8 (pre-release), 69 bytes

lambda n:(r:=range(2,n+1),[math.prod(r)+i for i in r])[1]
import math

Try it online!

Python 3.8 (pre-release), 69 62 bytes

lambda n:[i-~math.factorial(n)for i in range(1,n)]
import math

Try it online!

Edit: changed math.prod to math.factorial, thanks to @l4m2

Source Link
Gábor Fekete
  • 3.5k
  • 1
  • 9
  • 19

Python 3.8 (pre-release), 69 bytes

lambda n:(r:=range(2,n+1),[math.prod(r)+i for i in r])[1]
import math

Try it online!