mersenneforum.org > Math Number of zero's in largest prime...
 Register FAQ Search Today's Posts Mark Forums Read

2006-03-27, 00:29   #34
Citrix

Jun 2003

3·5·107 Posts

Quote:
 Originally Posted by jinydu For the first few Mersenne primes: Code: Exponent Total number of zeroes 2 1 3 1 5 2 From there, it gets too tedious to manually ask Mathematica to write out the expansion for each individual base (in any case, Mathematica is unable to handle bases larger than 36).
Why is there a zero in base? Can anyone explain?

All numbers that are multiples of 2 can also be excluded.

2006-03-27, 00:46   #35
Citrix

Jun 2003

3·5·107 Posts

Quote:
 Originally Posted by Citrix Why is there a zero in base? Can anyone explain?

2006-03-27, 00:50   #36
John Renze

Nov 2005

24·3 Posts

Quote:
 Originally Posted by jinydu in any case, Mathematica is unable to handle bases larger than 36.
Mathematica can do this. Use IntegerDigits rather than BaseForm.

 2006-03-27, 00:56 #37 grandpascorpion     Jan 2005 Transdniestr 503 Posts That's not true, Citrix. Mersenne primes can have zeroes in even bases. Why use Mathematica anyways? All you need is div and mod to get base values. Last fiddled with by grandpascorpion on 2006-03-27 at 01:00
2006-03-27, 01:10   #38
Citrix

Jun 2003

3×5×107 Posts

Quote:
 Originally Posted by grandpascorpion That's not true, Citrix. Mersenne primes can have zeroes in even bases.

Can you give an example?

Aside from this, I leave it as a puzzle to find the largest base for all Mp that produces a zero. I have the answer to this one.

 2006-03-27, 01:44 #39 grandpascorpion     Jan 2005 Transdniestr 503 Posts Not handy. It will be a good exercise for you. Why do you make these silly sweeping statements without a little investigation? Last fiddled with by grandpascorpion on 2006-03-27 at 01:47
 2006-03-27, 03:30 #40 Citrix     Jun 2003 3·5·107 Posts Yes you are right Consider numbers in base 10, which is even. I should think more before posting. Another puzzle (I do not have the answer), which base has the largest number of zero's for M43?
 2006-03-27, 04:03 #41 grandpascorpion     Jan 2005 Transdniestr 503 Posts Chances are that it's three. Last fiddled with by grandpascorpion on 2006-03-27 at 04:04
2006-03-27, 06:08   #42
Uncwilly
6809 > 6502

"""""""""""""""""""
Aug 2003
101×103 Posts

101010100010002 Posts

Quote:
 Originally Posted by patrik (with editing) Then the number of digits in base i is about p log 2 / log i. the distribution of digits for base 10 it looks like the digits are equally likely to occur. Or we could start the summing at 3 since we know our assumption is wrong for base i=2.
What I did in this regards:

Assume that all bases will have a roughly even distribution of digits (by this I mean representational characters, e.g. for hexadecimal the 'digits' would be 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F). (Now this won't be true at the higher bases, as many will have a leading 1)
Calculate the length (l) of the exponent in base n. Divide l by n (to get an approximation of the number of zeros in the particular base), sum this number for all bases (starting at 3) to M43.

The result was: 1,529,591,493

A bit brute force and not exact.

Code:
 10   Prime = 30402457 : Zeros=0
20   for Base = 3 to Prime
30   L_g = log( Prime ) / log( Base )
40   N_l = L_g * Prime
50   Digits = ( N_l / Base )
60   Zeros = Zeros + Digits
70   next Base
80   print Zeros

2006-03-28, 01:13   #43
paulunderwood

Sep 2002
Database er0rr

2×33×83 Posts

Your code is okay, except the loop for "base" should be up to 2^30402457-1 and not 30402457 . The loop should bail out when digits count became two and instead just add 1 to the count of zeroes -- the number 10_{base M43} because it is prime -- to save time on the loop

and you could have coded
Quote:
 50 Digits = ( N_l / Base )
with "-1".

A mathematical approach is needed such as given by "patrik" above to get a realististic figure -- I haven't checked "patrik"'s claim but at least your brute force method's expected number of zeroes is less than "patrik"'s mathematically computed expected number of them.

2006-03-28, 01:42   #44
paulunderwood

Sep 2002
Database er0rr

448210 Posts

And shouldn't
Quote:
 30 L_g = log( Prime ) / log( Base )
be
Quote:
 30 L_g = log( 2 ) / log( Base )
?

 Similar Threads Thread Thread Starter Forum Replies Last Post dabaichi News 571 2020-10-26 11:02 R.D. Silverman Data 82 2013-08-14 15:58 Prime95 Miscellaneous Math 20 2008-07-29 16:58 wfgarnett3 PSearch 1 2004-06-28 20:51 McBryce Lounge 39 2003-08-12 19:35

All times are UTC. The time now is 00:39.

Sat Jan 28 00:39:58 UTC 2023 up 162 days, 22:08, 0 users, load averages: 1.10, 1.33, 1.25