Write a recursive function that takes as input
a positive integer N and determines the sum of the squares
of the numbers from 1 to N. That is, given N, calculate:
Using this function write a complete Turing program that continuously reads in the value N, and calls the function to calculate the sum of the squares from 1 to N. The program should exit when the input value of N is less than 0.
For example, an input/output sequence would be as follows;
Input: 4 Output: The sum of the squares from 1 to 4 is 30 Input: 6 Output: The sum of the squares from 1 to 6 is 91 Input: -3 Output: <program exits>
The function you write must be recursive. No marks will be given for a non-recursive implementation.