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.


I think the limit is zero.

ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, 300}]]
  • $\begingroup$ Plot[n Sin[2 Pi E Factorial[n]], {n, 0, 15}] $\endgroup$
    – BoLe
    Commented Mar 13, 2014 at 9:53
  • 1
    $\begingroup$ 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) $\endgroup$ Commented Mar 13, 2014 at 10:03
  • $\begingroup$ @WilliamBriand I think the limit is zero. ListPlot[Table[n Sin[2 Pi E Factorial[n]], {n, 0, 300}]] $\endgroup$
    – alex
    Commented Mar 13, 2014 at 12:50
  • 1
    $\begingroup$ Try that plot using N[n*Sin[2 Pi E n!],1000]. $\endgroup$ Commented Mar 13, 2014 at 13:28
  • $\begingroup$ @WilliamBriand The solution at those links does not seem to work any more. (Mma 11, Win 10) $\endgroup$
    – Alan
    Commented Sep 4, 2016 at 15:04

4 Answers 4


Such things are simple in Mathematica

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

$2 \pi$


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

 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}]]

enter image description here

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]}]

enter image description here

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]}]

enter image description here

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.

  • 1
    $\begingroup$ 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. $\endgroup$
    – Sora.
    Commented Nov 19, 2015 at 1:27

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     *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.