# [R], 33 bytes Or **[R]>=4.1, 26 bytes** by replacing the word `function` with `\`. <!-- language-all: lang-r --> function(p)(rev(n<-seq(p))*n)%*%p [Try it online!][TIO-kwpcc3zh] [R]: https://www.r-project.org/ [TIO-kwpcc3zh]: https://tio.run/##NYlJCoAwEATvvsKLMCM6ZDExir5GDHiJu9@Pg8FLF111RD9Gf4fpWtYAG8IxPxCG@px3flgGLMpiix4mUC0ZUeXKkGCkbcUHm96fRLINKcPSdWSZWjpStsolV6cTpUbMPDS9xPgC "R – Try It Online"