New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new feature Schur_Number #14493
Conversation
for j in subset: | ||
if i + j in subset: | ||
raise AssertionError("This subset is not sum free") | ||
return "Everything is correct" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not necessary
""" | ||
Checks if the occurance of all numbers is exactly one | ||
""" | ||
t = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests should go inside of a test function. See how the other test files in SymPy are organized.
Would it also be useful for this function to work symbolically? |
I have changed the files now and I added the symbolic representation of the inequality. I think that the result of the function cannot be represented symbolically because there is no formula derived except from the last subset which has numbers of the form 3*n + 1 |
Symbolically means the function would be a Function subclass which remains unevaluated on symbolic inputs. |
It looks like a nice feature. @slacker404 Would you like to continue your work on this? |
I would like to work on this. Please guide as to what is remaining to be implemented. I will come up with a PR soon |
I would like to revive this PR, and I am planning to do it today. @sachin-4099 We can work on this together if its ok with you, it is fine by me. |
It is fine by me.. |
Closing in favour of #18667 |
The Schur number S(k) is the largest integer n for which the interval [1,n] can be partitioned into k sum-free sets. http://mathworld.wolfram.com/SchurNumber.html
I have also made the partition which can be proven by induction and I have added test cases