So you want to compute the value of e and the time required to compute that value for each element of n? A couple of suggestions:
function [e, a] = calcEulerSum2(n)
Make the variable e an array of ones the same size as n. The documentation page for ones include a couple of examples that you can use as a model.
Before you start timing, you'll need a loop over the elements of the input. Use the numel function that gives the number of elements in an array for this loop.
for whichElement = <you fill this in>
Continuing on with the code you already wrote:
You don't want to use the whole n array here, just one element. Which element should you use instead of n here? I think you can guess.
Since e is now an array here, not just one value, you need to operate on and assign back into a particular element. Which element of e? It should be clear.
By the way, you'll need to adjust how (or more precisely where/when) you initialize den. If the first element of n was 3, what should den be when you start processing the second element of n and what will it actually be?
Since I added a for loop to your code, you'll need one more end statement. Where should the for loop I added end?