Repository: sympy/sympy

Issue:
One is composite in new assumptions
```
In [1]: from sympy import *

In [2]: S(1).is_composite
Out[2]: False

In [3]: ask(Q.composite(1))
Out[3]: True  # should be False
```

Discussion:

Patch:
diff --git a/sympy/assumptions/handlers/ntheory.py b/sympy/assumptions/handlers/ntheory.py
index 539d9fca15..dcd12163b3 100644
--- a/sympy/assumptions/handlers/ntheory.py
+++ b/sympy/assumptions/handlers/ntheory.py
@@ -85,6 +85,10 @@ def Basic(expr, assumptions):
                 _prime = ask(Q.prime(expr), assumptions)
                 if _prime is None:
                     return
+                # Positive integer which is not prime is not
+                # necessarily composite
+                if expr.equals(1):
+                    return False
                 return not _prime
             else:
                 return _integer


Test patch:
diff --git a/sympy/assumptions/tests/test_query.py b/sympy/assumptions/tests/test_query.py
index e11f5dcdc7..4bf8e2639b 100644
--- a/sympy/assumptions/tests/test_query.py
+++ b/sympy/assumptions/tests/test_query.py
@@ -39,7 +39,7 @@ def test_int_1():
     assert ask(Q.finite(z)) is True
     assert ask(Q.infinitesimal(z)) is False
     assert ask(Q.prime(z)) is False
-    assert ask(Q.composite(z)) is True
+    assert ask(Q.composite(z)) is False
     assert ask(Q.hermitian(z)) is True
     assert ask(Q.antihermitian(z)) is False
 
@@ -102,7 +102,7 @@ def test_float_1():
     assert ask(Q.finite(z)) is True
     assert ask(Q.infinitesimal(z)) is False
     assert ask(Q.prime(z)) is False
-    assert ask(Q.composite(z)) is True
+    assert ask(Q.composite(z)) is False
     assert ask(Q.hermitian(z)) is True
     assert ask(Q.antihermitian(z)) is False