This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients PedanticHacker, Stefan Pochmann, mark.dickinson, mcognetta, pablogsal, rhettinger, serhiy.storchaka, tim.peters
Date 2021-12-21.09:15:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
That computation of the shift can be simplified to require only one popcount operation. With F and Finv as before:

def comb_small(n, k):
    assert 0 <= k <= n <= Nmax
    return (F[n] * Finv[k] * Finv[n-k] % 2**64) << (k ^ n ^ (n-k)).bit_count()
Date User Action Args
2021-12-21 09:15:25mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, serhiy.storchaka, PedanticHacker, mcognetta, Stefan Pochmann, pablogsal
2021-12-21 09:15:25mark.dickinsonsetmessageid: <>
2021-12-21 09:15:25mark.dickinsonlinkissue37295 messages
2021-12-21 09:15:25mark.dickinsoncreate