For which $k$ with $0<k<210637$ is $k\times 3571\# \pm 1$ a twin-prime-pair?

102 Views Asked by At

Because PARI/GP is not very fast in primilaty testing, I did not check the pairs $k \times 3571\# \pm 1$ in ascending order, but I begun with $k=200,000$ and got the twin prime pair

$$210637\times 3571\# \pm 1$$

  • Is there a $k$ with $0<k<210637$, such that $k\times 3571 \# \pm 1$ is a twin prime pair ?

I tried to sieve out small factors, but it turned out that many candidates remain because no member of any pair can have a prime factor $\le 3517$.

  • Can I speed up the search with PARI/GP by using some clever sieving methods ?
2

There are 2 best solutions below

2
On BEST ANSWER

I don't know about PARI/GP, but NewPGen can sieve pretty fast. Running the interval $0<k<200000$ for one minute eliminated about 170000 candidates.

https://primes.utm.edu/programs/NewPGen/

@Edit: I could have perhaps explained the programm a bit. It only sieves, for testing you need another program. Pfgw performs probable prime tests, and best thing is, it can use the files created by NewPGen.

http://sourceforge.net/projects/openpfgw/

4
On

It's not NewPGen with nice sieving of these forms, but using the simple is_prime($n-1) && is_prime($n+1) method took Perl/ntheory 20 minutes on my laptop to find k=45593, 9 minutes more for k=65996, 47 seconds more for k=67724, ...

In all, 1.5 hours for the whole range to get:

45593, 65996, 67724, 120451, 127964, 210637

The NewPGen executables don't work on my Macbook, and 282 doesn't compile. Anyone know of something newer than 282 or fixes for 64-bit (it's trying to store a pointer in a int)?

Ideas for sieving $k * n\# \pm a$ would be nice to see.