# Large and infinite sums evaluated numerically

I am interested to learn when and how Mathematica is able to evaluate large/infinite sums numerically in reasonable time. I have found that it can evaluate $$\sum_{l=1}^{\infty}e^{il/2}H_{0}^{(1)}(l)$$ or any finite truncation of this in a fraction of a second:

NSum[Exp[I 0.5 l] HankelH1[0, l], {l, 1, 10000000000}]
NSum[Exp[I 0.5 l] HankelH1[0, l], {l, 1, 100000000000}]
NSum[Exp[I 0.5 l] HankelH1[0, l], {l, 1, 1000000000000}]
NSum[Exp[I 0.5 l] HankelH1[0, l], {l, 1, Infinity}]


How is it able to do this? I'm not aware of any exact formula for this sum (if there is one please let me know!), and the sum doesn't even converge very rapidly, with the terms dying off as $$O(1/l^{1/2})$$ in absolute value.

Thanks in advance for any help.

• – Henrik Schumacher Apr 19 at 8:29
• Normal[Series[ Exp[I/2 l] HankelH1[0, l], {l, Infinity, 2}]] // Simplify produces $$\frac{\left(\frac{1}{8}-\frac{i}{8}\right) e^{\frac{3 i l}{2}} (8 l-i)}{\sqrt{\pi } l^{3/2}}$$ This means the series under considerationis not absolutely convergent. – user64494 Apr 19 at 10:29