I am quite simply looking for a function that I forgot about from way back when. I am positive I learned this at some point in grade school, but I just can't remember what it is called!
The function in question is:
if a = 0: f(a,b) = 0
if a ≠ 0: f(a,b) = f(b,a – 1) + b
I am hoping that someone can remember what this is called! Thanks in advance!
EDIT
I am providing the simple code that I came up with that runs in Python. It does seem to be multiplication:
def f(a,b,string):
if (a==0):
print (string)
return 0
if (a!=0):
string += ( " + "+str(b) )
return (f(b,a-1,string)+b)
NEXT QUESTION: Is there a proof for this anywhere?
Multiplication it is! We prove this by induction on $a$ and $b$.
In fact, we could restrict the induction hypothesis to only $a-1$ and $b-1$ instead of all integers smaller than $a$ and $b$.