Repository: sympy/sympy

Issue:
Sum(sin(n), (n, 1, oo)).is_convergent() is not implemented
`>>> Sum(sin(n), (n, 1, oo)).is_convergent()`
Traceback (most recent call last):

  File "<ipython-input-7-5c5f3b72e2d9>", line 1, in <module>
    Sum(sin(n), (n, 1, oo)).is_convergent()

  File "C:\Users\Roland\Anaconda3\lib\site-packages\sympy\concrete\summations.py", line 528, in is_convergent
    "is not yet implemented" % (sequence_term))

NotImplementedError: The algorithm to find the Sum convergence of sin(n) is not yet implemented

Discussion:

Patch:
diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py
index e167c77e46..e093cc46d4 100644
--- a/sympy/concrete/summations.py
+++ b/sympy/concrete/summations.py
@@ -536,7 +536,7 @@ def is_convergent(self):
         ratio = combsimp(powsimp(next_sequence_term/sequence_term))
         try:
             lim_ratio = limit_seq(ratio, sym)
-            if lim_ratio is not None and lim_ratio.is_number:
+            if lim_ratio is not None and lim_ratio.is_number and lim_ratio is not S.NaN:
                 if abs(lim_ratio) > 1:
                     return S.false
                 if abs(lim_ratio) < 1:


Test patch:
diff --git a/sympy/concrete/tests/test_sums_products.py b/sympy/concrete/tests/test_sums_products.py
index 806f2edb1c..eeb923c248 100644
--- a/sympy/concrete/tests/test_sums_products.py
+++ b/sympy/concrete/tests/test_sums_products.py
@@ -1057,6 +1057,7 @@ def test_is_convergent():
     assert Sum((-1)**n*n, (n, 3, oo)).is_convergent() is S.false
     assert Sum((-1)**n, (n, 1, oo)).is_convergent() is S.false
     assert Sum(log(1/n), (n, 2, oo)).is_convergent() is S.false
+    assert Sum(sin(n), (n, 1, oo)).is_convergent() is S.false
 
     # Raabe's test --
     assert Sum(Product((3*m),(m,1,n))/Product((3*m+4),(m,1,n)),(n,1,oo)).is_convergent() is S.true
@@ -1157,6 +1158,11 @@ def test_issue_10973():
     assert Sum((-n + (n**3 + 1)**(S(1)/3))/log(n), (n, 1, oo)).is_convergent() is S.true
 
 
+def test_issue_14103():
+    assert Sum(sin(n)**2 + cos(n)**2 - 1, (n, 1, oo)).is_convergent() is S.true
+    assert Sum(sin(pi*n), (n, 1, oo)).is_convergent() is S.true
+
+
 def test_issue_14129():
     x = Symbol('x', zero=False)
     assert Sum( k*x**k, (k, 0, n-1)).doit() == \