{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/8677","labels_url":"https://api.github.com/repos/sympy/sympy/issues/8677/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/8677/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/8677/events","html_url":"https://github.com/sympy/sympy/issues/8677","id":52603946,"number":8677,"title":"factorial(n) should \"know\" that it is divisible by n","user":{"login":"pelegm","id":3422626,"avatar_url":"https://avatars.githubusercontent.com/u/3422626?v=3","gravatar_id":"","url":"https://api.github.com/users/pelegm","html_url":"https://github.com/pelegm","followers_url":"https://api.github.com/users/pelegm/followers","following_url":"https://api.github.com/users/pelegm/following{/other_user}","gists_url":"https://api.github.com/users/pelegm/gists{/gist_id}","starred_url":"https://api.github.com/users/pelegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelegm/subscriptions","organizations_url":"https://api.github.com/users/pelegm/orgs","repos_url":"https://api.github.com/users/pelegm/repos","events_url":"https://api.github.com/users/pelegm/events{/privacy}","received_events_url":"https://api.github.com/users/pelegm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sympy/sympy/labels/enhancement","name":"enhancement","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-12-21T19:37:26Z","updated_at":"2015-01-02T15:16:14Z","closed_at":null,"body":"This is related to #8531, but is not really the same.\r\n\r\nIt would be nice if `factorial(n)` would \"know\" that it divisible by `n`, or, even better, that it is divisible by any `k` for which `1 <= k <= n`. `n` and `k` in my example are both positive integers.\r\n\r\nFormally, it would be nice if `factorial(n) % n` would simplify automatically to 0, and even better, that `factorial(n) % k` would simplify to 0 if `k` is known to be an integer from `1` to `n`.\r\n\r\nCurrently, something a little bit weird happens.\r\n```python\r\n>>> n = Symbol('n', integer=True, positive=True)\r\n>>> (factorial(n) % n).equals(0)\r\nFalse\r\n```\r\nHowever, any substitution of positive integer `n` would return 0, so something is wrong there.  (Note: this is fixed in #8687)"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/68533298","html_url":"https://github.com/sympy/sympy/issues/8677#issuecomment-68533298","issue_url":"https://api.github.com/repos/sympy/sympy/issues/8677","id":68533298,"user":{"login":"pelegm","id":3422626,"avatar_url":"https://avatars.githubusercontent.com/u/3422626?v=3","gravatar_id":"","url":"https://api.github.com/users/pelegm","html_url":"https://github.com/pelegm","followers_url":"https://api.github.com/users/pelegm/followers","following_url":"https://api.github.com/users/pelegm/following{/other_user}","gists_url":"https://api.github.com/users/pelegm/gists{/gist_id}","starred_url":"https://api.github.com/users/pelegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelegm/subscriptions","organizations_url":"https://api.github.com/users/pelegm/orgs","repos_url":"https://api.github.com/users/pelegm/repos","events_url":"https://api.github.com/users/pelegm/events{/privacy}","received_events_url":"https://api.github.com/users/pelegm/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T15:16:14Z","updated_at":"2015-01-02T15:16:14Z","body":"My proposition regarding the bounds can also help solving #8533. I agree with @asmeurer that doing so with inequalities is probably a better idea, but I was wondering **(a)** whether this is possible in the \"old\" assumptions system, and **(b)** how can I really implement it in the \"new\" assumptions system."}}