function [ output ] = sumSquaresRecursive( input )
%computes the sum of the squares of the integers from 1 to input
%input: integer >= 1
%output: integer
%Roger Craig, 3/6/2009
%   Calculates the sum of the squares of the integers form 1 to 
% the input integer
% where the sequence is (1, 4, 9, 16, 25,...)
%Examples:
% sumSquaresRecursive(2) = 5
% sumSquaresRecursive(3) = 14
% sumSquaresRecursive(7) = 140

if (input == 1) 
   output = 1;  %base case
else
   output = input^2 + sumSquaresRecursive(input - 1);  %recursive case
end

end

