Limit of sequence

I tried to calculate the following limit $$\lim_{n\to\infty}n\sin(2\pi en!)$$ Mathematica gets

In[1]:= Limit[n*Sin[2 Pi*n!*Exp[1]], {n -> Infinity}]

Out[1]= {Interval[{-\[Infinity], \[Infinity]}]


But by the following link the answer is $2\pi$. I'm confused.

https://math.stackexchange.com/questions/76097/what-is-the-limit-of-n-sin-2-pi-cdot-e-cdot-n-as-n-goes-to-infinity

I think the limit is zero.

ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, 300}]]

• Plot[n Sin[2 Pi E Factorial[n]], {n, 0, 15}] – BoLe Mar 13 '14 at 9:53
• Limit give the limit of the expression as a real function (its divergent, thus the [-inf;inf] ), and not the limit of a sequence. See forums.wolfram.com/mathgroup/archive/2000/Sep/msg00318.html and forums.wolfram.com/mathgroup/archive/1999/Jul/msg00375.html for some strategies to evaluate limits of sequence (spoiler : they don't work here, you have to do the math) – William Briand Mar 13 '14 at 10:03
• @WilliamBriand I think the limit is zero. ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, 300}]] – alex Mar 13 '14 at 12:50
• Try that plot using N[n*Sin[2 Pi E n!],1000]. – Daniel Lichtblau Mar 13 '14 at 13:28
• @WilliamBriand The solution at those links does not seem to work any more. (Mma 11, Win 10) – Alan Sep 4 '16 at 15:04

In the call to Limit, there doesn't seem to be any way to restrict the function to integers.

When I try

Limit[Ceiling[n] Sin[2 Pi E Factorial[Ceiling[n]]], n -> ∞]


as @Sora suggested, it just hangs (and I'm too impatient to wait more than 10 minutes). Since the factorial is only defined for nonnegative integers, the limit is indeed $2\pi$ as suggest in the linked post.

You can see that when you allow the factorial to take real numbers as input, by using the gamma function, then the result oscillates with monotonically increasing amplitude

Show[
Plot[n Sin[2 Pi E Factorial[n]], {n, 1, 10}, PlotPoints -> 300],
ListPlot[# Sin[2 Pi E Factorial[#]] & /@ Range[1, 10],
PlotStyle -> {PointSize[Large], Red}]]


So the limit with n as a real number really is +/- ∞. But over integers? You can see here that as n gets larger it appears to go to $2\pi$, but for n greater than 50, it goes to zero

Show[{ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, nm, 1}]],
Plot[2 π, {x, 0, nm}, PlotStyle -> Red]}]


I think this is simply because Mathematica is trying to take the Sin of an extremely large number, and it switches to another algorithm once the number is large enough. As Daniel Lichtblau pointed out, it even fails for much smaller numbers when they are taken as floating points instead of integers.

Show[{ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, nm, 1.0}]],
Plot[2 π, {x, 0, nm}, PlotStyle -> Red]}]


For numbers so large, $20! \approx 10^{18}$, the Sin function is apparently very sensitive to even the smallest variation in precision.

So the limit truly is $2\pi$, not zero, but I don't know how to get Mathematica to show it.

• Having taken a look at the documentation, there is a nice way to evaluate a limit over the integers: if you consider the sequence $f(n)=(-1)^{2n}(1+\frac1n)$, Limit[f[n],n->Infinity] will tell you the expression diverges (as a real function), but using Limit[f[n],n->Infinity,Assumptions->{Element[n,Integers]}] will give you the correct value of 1. However, as you have already mentioned, in this case it fails due to the huge factorial expressions Mathematica's sine function can't handle properly. Still haven't found a real Mathematica solution for that either. – Sora. Nov 19 '15 at 1:27

Such things are simple in Mathematica 11.2.0.0

DiscreteLimit[n*Sin[2 Pi*n!*Exp[1]], {n -> Infinity}]


$2 \pi$

I know the answer is a bit late, but - from a mathematician's point of view, I'm not that much of an expert when it comes to Mathematica - why don't you just replace every occurence of $n$ by $\lceil n\rceil$?

If $(a_n)_{n\in\mathbb N}$ is a convergent real sequence, then $f:\mathbb R_{>0}\to\mathbb R,\ f(x):=a_{\lceil x\rceil}$ will be a convergent real function having the exact same limit.

There is an easy and elegant way to show the limit is 2 Pi with MMA (Using Version 8.0)

Use the identity for E

E == Sum[1/k!, {k, 0, Infinity}]


Since k a priori goes to Infinity, all summands of the sum n!*E, where k <= n are multiples of 2 Pi and can be ignored.

Write k as j + n to get the fractional part and sum up to infinity

su = Sum[n!/(j + n)!, {j, 1, Infinity}]

(*     E Gamma[1 + n] - E Gamma[1 + n, 1]     *)


Now insert this instead of n!*E to get the result 2 Pi

Limit[n Sin[2 Pi su], n -> Infinity]

(*     2 Pi     *)