wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> prime triplet
(Message started by: Christine on May 15th, 2013, 11:03am)

Title: prime triplet
Post by Christine on May 15th, 2013, 11:03am
Prime triplets of the form (p, p+2, p+6) or (p, p+4, p+6)

other tiplets of the form
http://mathworld.wolfram.com/PrimeTriplet.html

is the sum of the members of a triplet always prime?


Title: Re: prime triplet
Post by towr on May 15th, 2013, 1:08pm
For p=191 (in both sequences) the sum of the triple is not prime ( 7 divides 3*191+8 and 11 divides 3*191+10).
And many, many other aren't either.

Title: Re: prime triplet
Post by Christine on May 15th, 2013, 1:55pm
Is there an analytical solution that explains for which condition(s) the sum would prime?

Title: Re: prime triplet
Post by towr on May 15th, 2013, 11:15pm
Maybe if the Riemann hypothesis is true. ;D
But as far as I'm concerned it's arbitrary.

Title: Re: prime triplet
Post by JohanC on May 23rd, 2013, 2:01pm
The sums of such triplets are neither divisible by 2 nor by 3. Therefore, small triplets have a slightly higher probability of having a prime sum.
The larger the triplet, the lower this influence.

Title: Re: prime triplet
Post by whize on May 29th, 2013, 3:47pm
First non-prime prime triplet sum for

p + (p+2) + (p+6)
is at p = 107, sum = 329
( 107, 191, 227, 461, 821, 881 are other primes under 1000 which break this rule)

p + (p+4) + (p+6) is not prime
for p = 13, sum = 49
(13, 37, 97, 103, 193, 223, 277, 307, 613, 823, 853, 877 are bad primes for this series)

There are 189 and 196 such primes below 100k respectively.

It does seem to be the case that the latter primes are more than the former.
Upto 1 million: 1087 vs 1151, diff 64
Upto 10 million: 6989 vs 7119, diff 130


It will be interesting to note if the non-primes in one of the categories is strictly more than the other, in an asymptotic sense.

Suboptimal python code to do this...


Code:
isPrime = lambda x : x%2 == 1 and all((x % z for z in xrange(3, int(pow(x, 0.5)) + 1, 2)))

def primeTriples(d1, d2, lim=10000):
   nonpts = []
   d3 = d1 + d2
   for x in range(3, lim, 2):
       if isPrime(x) and isPrime(x + d1) and isPrime(x + d2):
           if not isPrime(3*x + d3):
               nonpts.append(x)
   return nonpts

def printOutput(lim):
   pt26 = primeTriples(2, 6, lim)
   pt46 = primeTriples(4, 6, lim)

   l26, l46 = len(pt26), len(pt46)
   print lim, l26, l46, l46 - l26

[printOutput(int(lim)) for lim in (1E3, 1E4, 1E5)]



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board