What I'm saying is that the a array is 1000 elements. These elements are index from 0 to 999
If your loop goes up to this k<=1000 value then at some point you will
be saying a[999+1]=a[999] and then a[1000+1]=a[1000] which are array out of bounds access.
The most your loop will be able to go to and stay withing the bounds of the array is 998.
so at most you will have a[998+1]=a[998] and the loop should then stop.
From a design perspective you may want to make lambda and m constant.
Then you may think about creating a class to move only your formula calculations to it i.e. a 'PowerSeries' class and have a method 'Calculate' that returns the an array with the output you want, or just the value of the nth series, etc.
You can make your constants (lambda and m) const members of that new class and the rest of variables (if any) you can pass them on the constructor or as parameters of the 'Calculate' method, etc. Now you can reuse you power series formulae from other programs.
The above is just for future development. I think the other guys have already more than solved your run-time problem.