## Re: Counting digit in other base

Expand Messages
• ... Expletive! I ve been running a pfgw script to answer David s question using the above 2^42643801-1 for the past 24 hours. I just noticed I should instead
Message 1 of 47 , Nov 9, 2010
--- In primenumbers@yahoogroups.com, Alan Eliasen <eliasen@...> wrote:
>
> On 11/08/2010 04:03 PM, djbroadhurst wrote:
> > Videlicet: How many 7's are there in the largest known prime,
> > when the latter is written in base 137?
> >
> > David (who has no idea, but might be told, eventually)
>
> It would be nice to get an answer to this, and edifying to people
> interested in the problem to see what the bottlenecks are. The number
> itself, 2^42643801-1, can be calculated with Java (with my patches)
Expletive!
I've been running a pfgw script to answer David's question using the above 2^42643801-1 for the past 24 hours.
I just noticed I should instead be using 2^43112609-1.
As it appears Kevin will soon have the answer I will not start a second attempt, at least for the time being.
cheers
Ken
> milliseconds (without my patches, several days. It's only a left-shift
> and a subtract, both of which can be done in small O(n) time.)
>
> Converting the radix in native Java will take days and days. Even
> though it has fast operations for bitCount, that's not much help here.
> (Even I can do in my head that there will be 42643801 ones and no
> zeroes, if we only want the binary digits). Scanning the final number
> for sevens can be done in milliseconds.
>
> (My wild estimate, which I may have bungled, is 43853 sevens in the
> number.)
>
> --
> Alan Eliasen
> eliasen@...
> http://futureboy.us/
>
• ... You will find, just as in Peter s original script, that the count of zeros has been left as an exercise for the reader. Kevin.
Message 47 of 47 , Nov 18, 2010
At 07:58 PM 18/11/2010, Christ van Willegen wrote:
>On Thu, Nov 18, 2010 at 9:47 AM, Di Maria Giovanni
><calimero22@...> wrote:
> >
> > Thank you very much.What'is the sintax of this function c(n,b,v)
> ?RegardsGiovanni
>It looks like you should be able to call it like:
>
>c(2^43112609-1, 137)
>
>IIRC it will return a vector with digit counts for all the digits 0..b-1
>
>Christ van Willegen

You will find, just as in Peter's original script, that the count of
zeros has been left as an exercise for the reader.

Kevin.
Your message has been successfully submitted and would be delivered to recipients shortly.