Repository: sympy/sympy

Issue:
bell(n).limit(n, oo) should be oo rather than bell(oo)
`bell(n).limit(n,oo)` should take the value infinity, but the current output is `bell(oo)`. As the Bell numbers represent the number of partitions of a set, it seems natural that `bell(oo)` should be able to be evaluated rather than be returned unevaluated. This issue is also in line with the recent fixes to the corresponding limit for the Fibonacci numbers and Lucas numbers.

```
from sympy import *
n = symbols('n')
bell(n).limit(n,oo)

Output:
bell(oo)
```

I'm new to Sympy, so I'd appreciate the opportunity to fix this bug myself if that's alright.


Discussion:

Patch:
diff --git a/sympy/functions/combinatorial/numbers.py b/sympy/functions/combinatorial/numbers.py
index b639372835..808886c285 100644
--- a/sympy/functions/combinatorial/numbers.py
+++ b/sympy/functions/combinatorial/numbers.py
@@ -424,6 +424,9 @@ def _bell_incomplete_poly(n, k, symbols):
 
     @classmethod
     def eval(cls, n, k_sym=None, symbols=None):
+        if n is S.Infinity:
+            return S.Infinity
+
         if n.is_Integer and n.is_nonnegative:
             if k_sym is None:
                 return Integer(cls._bell(int(n)))


Test patch:
diff --git a/sympy/functions/combinatorial/tests/test_comb_numbers.py b/sympy/functions/combinatorial/tests/test_comb_numbers.py
index b201a4ea4a..6fab11a441 100644
--- a/sympy/functions/combinatorial/tests/test_comb_numbers.py
+++ b/sympy/functions/combinatorial/tests/test_comb_numbers.py
@@ -103,6 +103,10 @@ def test_bell():
     m = Symbol('m', integer=True)
     assert bell(-1).evalf() == bell(m).rewrite(Sum).evalf(subs={m: -1})
 
+    # issue 9184
+    n = Dummy('n')
+    assert bell(n).limit(n, S.Infinity) == S.Infinity
+
 
 def test_harmonic():
     n = Symbol("n")