This is the recursion example (p.97) used in "Programming Interviews Exposed"
by John Mongan, Noah Suojanen, Eric Giguère
The book's imperative style C# code (function combine) has been reimplemented in Scala.
Function recursionEx is in pure FP way.
Function tailReccursionEx is implemented to get TCO'ed (TCO=Tail Call Optimization)
Here is the problem statement: