I know it's basically a function calling itself, but no matter how I try, it always drops a lot of errors.

https://onlinegdb.com/J3oAdhKTWK

I don't really understand recursives, so let me analyze it and correct me if I'm wrong.

def recursive(n):

n += n

if n == 1:

return n

else:

return n + recursive(n-1)

"def recursive(n):" - Creates a functions that requires a "n" parameter.

"n += n" - Multiplies given number by 2 or adds the given number to itself.

"if n == 1" - Checks if the given "n" parameter is equals to 1.

"return n" - If the If statement is true, it returns "n" parameter.

"else:" - If the if statement is false, execute whatever is after.

"return n + recursive(n-1)" - The part I don't really understand.