mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2015-11-25, 11:42   #144
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2×683 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
or we can do N=4 and use 0 mod 2,2 mod 3 and 4 mod 5 and get the lowest example 24,25,26,27 which will always repeat mod 30. we can also increase this to N=5.
24 is not congruent to 2 mod 3.
With my previous setting we have a=2 (mod 30), so I had to select a=32 to avoid a prime. But if we know that N>=3, we can use a=0 (mod 2), a=0 (mod 3), a=4 (mod 5) and so on and in that case we get a=24.

For N=7, using the same idea: a=0 (mod 2), a=0 (mod 3), a=4 (mod 5), a=2 (mod 7). Thus we get M = 2*3*5*7 = 210, a=114.
So the seven consecutive numbers would be 114 (multiple of 2), 115 (multiple of 5), 116 (multiple of 2), 117 (multiple of 3), 118 (multiple of 2), 119 (multiple of 7), 120 (multiple of 2).
alpertron is offline   Reply With Quote
Old 2015-11-25, 11:57   #145
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by alpertron View Post
24 is not congruent to 2 mod 3.
With my previous setting we have a=2 (mod 30), so I had to select a=32 to avoid a prime. But if we know that N>=3, we can use a=0 (mod 2), a=0 (mod 3), a=4 (mod 5) and so on and in that case we get a=24.

For N=7, using the same idea: a=0 (mod 2), a=0 (mod 3), a=4 (mod 5), a=2 (mod 7). Thus we get M = 2*3*5*7 = 210, a=114.
So the seven consecutive numbers would be 114 (multiple of 2), 115 (multiple of 5), 116 (multiple of 2), 117 (multiple of 3), 118 (multiple of 2), 119 (multiple of 7), 120 (multiple of 2).
sorry typo 0 mod 3 but the point was that there was a lower set and that mod 30 it repeats infinitely often.
science_man_88 is offline   Reply With Quote
Old 2015-11-25, 15:41   #146
davar55
 
davar55's Avatar
 
May 2004
New York City

102128 Posts
Default

Quote:
Originally Posted by davar55 View Post
I don't understand this poster. Is he entitled to an answer?
Quote:
Originally Posted by chalsall View Post
Yes.
ok, no problem.

By the way, the series 32,33,34,35 contains four composites, but 36 is also composite.
What is the smallest sequence of N composites P+1,P+2,...,P+N with P and P+N+1 prime?
davar55 is offline   Reply With Quote
Old 2015-11-25, 15:49   #147
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

961110 Posts
Default

Quote:
Originally Posted by davar55 View Post
What is the smallest sequence of N composites P+1,P+2,...,P+N with P and P+N+1 prime?
Well, it would not make much sense for an even N, would it?
Of course, except 2, all primes are odd, therefore there is number of odd numbers between two odd numbers.
In his example N=4, therefore at least 5 composites must be there, if there are 4.
The smallest example for 4 (5) is 23-29. See prime gaps...
31-37 in the example is the second.





[edit: link and link, and many other links]
[edit 2: remark that for example gap 14 (i.e. 13 composites) appears before gap 10 (9) and gap 12 (11 composites), so again, it depends how you count]

Last fiddled with by LaurV on 2015-11-25 at 16:05
LaurV is offline   Reply With Quote
Old 2015-11-25, 16:09   #148
axn
 
axn's Avatar
 
Jun 2003

5,051 Posts
Default

Quote:
Originally Posted by alpertron View Post
An idea that SM88 told me by PM in order to reduce the value of a is to reuse the factor 2 for not only the first congruence but for all odd congruences. In the case N=4 we would get a=0 (mod 2), a=2 (mod 3) and a=2 (mod 5), thus M=30 and a=32. This generates the four composite numbers 32, 33, 34 and 35.

In this case it would be difficult to express the result using a formula.
This can be generalized to all primes, not just 2. Sort of like SoE.

a = 0 (mod 2) ==> a+2, a+4, ... can be "sieved out"
a+1 (the first one not yet sieved out = 0 (mod 3) ==> a+7, a+13, a+19, ... can be sieved out
a+3 = 0 (mod 5) ==> a+13, a+23, ... can be sieved out
and so on.
Then only solve for the set of first congruence for each prime.

EDIT:- This effectively boils down to having an array of N elements with the ith element equal to the smallest factor of i. This obviously requires all primes <= N, and thus the number will be about N# But then, we can do much better by running the index from -(N/2) to (N/2). So now we need only primes <= N/2 and so the size will be roughly halved to (N/2)#

Last fiddled with by axn on 2015-11-25 at 16:40
axn is offline   Reply With Quote
Old 2015-11-25, 16:40   #149
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

2×683 Posts
Default

But in this case it would not be possible to find an explicit formula for the first number of the sequence.
alpertron is offline   Reply With Quote
Old 2015-11-25, 16:57   #150
axn
 
axn's Avatar
 
Jun 2003

5,051 Posts
Default

Quote:
Originally Posted by henryzz View Post
A formula/algorithm that would work for any N.
Quote:
Originally Posted by alpertron View Post
But in this case it would not be possible to find an explicit formula for the first number of the sequence.
Formula, no. Algorithm, yes. The difference in size is big: P(N)# vs N# vs (N/2)#

EDIT:- If search is allowed, just look for m*(N/2)#, with m running from 1,2,... Except for m*(N/2)+/-1, everything in the range m*(N/2)+/-N is trivially composite. You'll probably get lucky with m=1 itself such that (N/2)#+/-1 is also composite.

Last fiddled with by axn on 2015-11-25 at 17:00
axn is offline   Reply With Quote
Old 2015-11-25, 17:36   #151
chris2be8
 
chris2be8's Avatar
 
Sep 2009

2·1,039 Posts
Default

Quote:
Originally Posted by LaurV View Post
Well, it would not make much sense for an even N, would it?
Except for N=0 since there are 0 composites between 2 and 3.

Chris
chris2be8 is offline   Reply With Quote
Old 2015-11-25, 17:46   #152
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by axn View Post
Formula, no. Algorithm, yes. The difference in size is big: P(N)# vs N# vs (N/2)#

EDIT:- If search is allowed, just look for m*(N/2)#, with m running from 1,2,... Except for m*(N/2)+/-1, everything in the range m*(N/2)+/-N is trivially composite. You'll probably get lucky with m=1 itself such that (N/2)#+/-1 is also composite.

I think you meant  \pm (N/2)
Code:
(13:36) gp > forprime(x=30030-26,30030+26,print(x))
30011
30013
30029
30047
30030 being the first primorial determined not have the +1 side not be prime. however the first to have -1 and +1 not be prime is 510510.

I also think you meant (N/2)# most of the time.
science_man_88 is offline   Reply With Quote
Old 2015-11-26, 02:32   #153
axn
 
axn's Avatar
 
Jun 2003

116738 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I think you meant  \pm (N/2)
Quote:
Originally Posted by science_man_88 View Post
I also think you meant (N/2)# most of the time.
Correct, to both!
axn is offline   Reply With Quote
Old 2015-11-26, 02:42   #154
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by axn View Post
Correct, to both!
technically we can still use pn# for a though it's not always needed to be that high ( I'd think), I was mostly just suggesting that only the lowest prime divisor of the number need be used potentially. we could in theory have ways to cover more that way though with limitations it's sounding doubtful.

Last fiddled with by science_man_88 on 2015-11-26 at 02:46
science_man_88 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stockfish game: "Move 9 poll", not "move 2^74,207,281-1 discussion" MooMoo2 Other Chess Games 1 2016-10-25 18:03
Stockfish game: "Move 8 poll", not "move 3.14159 discussion" MooMoo2 Other Chess Games 5 2016-10-22 01:55
Scottish game: "Move 6 poll", not "move -1 discussion" MooMoo2 Other Chess Games 0 2016-10-11 16:30
Stockfish game: "Move 5 poll", not "move 0 discussion" MooMoo2 Other Chess Games 0 2016-10-05 15:50
Problem E7 of Richard Guy's "Unsolved problems in number theory" Batalov Computer Science & Computational Number Theory 40 2013-03-16 09:19

All times are UTC. The time now is 18:46.


Fri Jul 16 18:46:36 UTC 2021 up 49 days, 16:33, 1 user, load averages: 3.24, 4.72, 4.64

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.