Best search algorithm to find condition within a range
Marko Rauhamaa
marko at pacujo.net
Wed Apr 8 00:31:14 EDT 2015
Steven D'Aprano <steve+comp.lang.python at pearwood.info>:
> On Wed, 8 Apr 2015 03:07 am, jonas.thornvall at gmail.com wrote:
>> Using base 429496729?
>
> That makes no sense. With base 429496729 you need to have 429496729
> different digits.
You can use integers as digits. We already do that when we express times
and angles in base-60. I think even the Babylonians might have used such
structured digits.
>>> x = 2932903594368438384328325832983294832483258958495845849584958458435439543858588435856958650865490
>>> while x >= 429496729: x //= 429496729
...
>>> x
31
Marko
More information about the Python-list
mailing list