Replies: 2 comments 5 replies
-
I think it is unlikely that any promise about the order of the factors would have been in the docs. Since Note also that sympy's printers ( In [9]: print(factorint(14152121))
{3917: 1, 3613: 1}
In [10]: factorint(14152121)
Out[10]: {3613: 1, 3917: 1}
In [16]: list(factorint(14152121))
Out[16]: [3917, 3613] You can use |
Beta Was this translation helpful? Give feedback.
-
I don't think that we need to enforce the sorting of the keys, if it is not different than users can call |
Beta Was this translation helpful? Give feedback.
-
I thought I had seen somewhere in the documentation (maybe the "original doc" of sympy or maybe some other website) that
# factorint must give prime factors in increasing order
and I had added this as a comment somewhere in a program where it might be relevant.
But somebody reported to me that he found a counter-example:
We've checked that up to 10^8 my program returns correct results anyways,
but I wanted to have a clear answer on whether factorint is supposed to give the factors in order (possibly (only?) in some "view" of the dict's keys) or not.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions