2021-03-14 11:49:28 +0200 | received badge | ● Popular Question (source) |
2015-04-07 07:21:44 +0200 | asked a question | Largest 2^n less than x? Other than iterating n and testing against x, is there a particular method in SAGE to find the largest 2^n less than a specified integer? Thanks CL |
2015-04-02 16:18:52 +0200 | received badge | ● Scholar (source) |
2015-04-02 16:15:22 +0200 | commented answer | Best way to divide by 2^n? That was very informative. Thanks for the answer. |
2015-04-02 10:01:20 +0200 | received badge | ● Student (source) |
2015-04-02 05:26:27 +0200 | received badge | ● Editor (source) |
2015-04-02 05:23:37 +0200 | asked a question | Best way to divide by 2^n? What would be the best way to divide an integer by 2^n in SAGE, where n is unknown? Specifically, I want to determine the value of x in integers of the following form (2^n)*x, where x is odd and I don't know n. ATM, I'm dividing by 2, then test whether result is 1 (mod2) and repeat if necessary. Is there a better way? edit: I prefer not to use factor() as x may be large (which would make factor() slow). I just want to identify x, not its factors. Thanks CL |