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.
Plot[n Sin[2 Pi E Factorial[n]], {n, 0, 15}]
$\endgroup$N[n*Sin[2 Pi E n!],1000]
. $\endgroup$