You can just run this code to try whether it runs into any practical boundaries, I believe it is exactly what you are looking for:
N = 1;
oldSum = -1;
mySum = 0;
tic
while oldSum~=mySum
oldSum = mySum;
mySum = mySum + 1/N;
N = N+1;
end
toc
N
On second thought, this may run on forever. If you use this line instead:
mySum = single(mySum + 1/N);
You can see the results for a datatype with less precision. In 21.5 seconds it reaches 2097153 iterations and terminates.
This can be used to test theoretical approaches.
UPDATE
I figured that instead of decreasing the precision, it is possible to increase the stepsize. Here is the code to get an approximation of the number, it should even not be that hard to get the estimated calculation time from this:
N = 1;
oldSum = -1;
mySum = 0;
p=10;
tic
while oldSum~=mySum && N
oldSum = mySum;
mySum = mySum + 1/N;
if N<1e9 % We need to build up till approximately the right number
N = N+1;
else % Here the decrease in 1/N is much more significant than the change in epsilon
N = N+1e8;
end
end
toc
This code finishes around N = 5.6295e+14
in 19 seconds, of which about 1 second is spent in large increases, and after some quick calculations I think the estimated time to do this would be about:
18 + 1e8 seconds or roughly 3 years.