Some code and problems solved in Mathematica and R in relation to: