ELI5: Explain Like I'm 5

McCarthy 91 function

The McCarthy 91 function is a computer programming concept that was created by computer scientist John McCarthy in the 1950s. It is a recursive function, which means it calls itself over and over again until a final result is reached. The McCarthy 91 function takes a single number (called 'n') as its input, and returns a result (called 'result'). The way it works is that, if n is greater than 100, the result is just n-10. If n is less than or equal to 100, the McCarthy 91 function calls itself (with n-11 as the input) and adds the result of that call to the original input n, and returns the result. So if n=5, then the function will call itself five times, each time with n-11 as the input, and each time it will add 5 to the result of the new call. Eventually, the value of n will reach 0, and the final result will be the sum of all the numbers in between 0 and the original input that was given.