— Can't you just see the simple pattern there?
— A simple
for loop, show what you've already done by now
— Need one single function of x for such output
— Def f(x) :
For i in range(1,x):
Answer += x
— And please don't make others homework, let them think, then help in specific issues
if x==1: return x
— Nope, well yes...
but recursion is not really needed