You don't need a separate function for factorial. It is easily calculated as part of the sequence. (You only need to know what the last term in the sequence was to compute the current.)
It always helps to write things out:
1 2 3 4
sum = --- + --- + ----- + ------- + ...
1 1*2 1*2*3 1*2*3*4
See any patterns?
Also, is there anything that can be reused from one term to the next?
#include <iostream>
int main()
{
double sum = 0;
int dProduct = 1;
for(int i = 1; i <= 6; i++)
{
dProduct *= i;
sum += i / static_cast<double>(dProduct);
}
std::cout << sum;
}
Hope this helps!
EDIT
So the formula for this is basically y = x/ x!. This is saying that as x approaches infinity, y will get infinitely closer to zero. That is why at around 2.718281 it stops incrementing by a notable amount.