How do I make a code that follows this? 1⋅2+2⋅3+3⋅4+…+(n−1)⋅n
1⋅2+2⋅3+3⋅4+…+(n−1)⋅n
For example, if n=5, the answer is 1⋅2+2⋅3+3⋅4+4⋅5=40.
n=5
1⋅2+2⋅3+3⋅4+4⋅5=40.
n c