mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   Countdown primes (https://www.mersenneforum.org/showthread.php?t=17214)

lavalamp 2012-09-21 18:42

Countdown primes
 
I was talking to someone a couple of days ago, who found that if you list the numbers 82 to 1, in base 10, in descending numerical order, it is prime.

ie: 82818079...54321

If we refer to numbers of this form as countdown-n, then this would be countdown-82 and is the only one which I know to be prime.

I thought I'd try to find the next one of these primes for higher values of n. So far I have failed and I believe my code to have searched up to at least n=10000, though unfortunately I did not include any progress reporting so I cannot check it.

I wrote the code in pari and it has been running for approximately 23 hours now, on one core of a 3.4 GHz i5 CPU. I didn't make any optimisations to reduce the runtime though, so I'm sure it's possible to search higher and faster.

So yeah, the puzzle is basically to find the next number, n, for which countdown-n is prime (or at least a probable prime).

science_man_88 2012-09-21 18:58

[QUOTE=lavalamp;312311]I was talking to someone a couple of days ago, who found that if you list the numbers 82 to 1, in base 10, in descending numerical order, it is prime.

ie: 82818079...54321

If we refer to numbers of this form as countdown-n, then this would be countdown-82 and is the only one which I know to be prime.

I thought I'd try to find the next one of these primes for higher values of n. So far I have failed and I believe my code to have searched up to at least n=10000, though unfortunately I did not include any progress reporting so I cannot check it.

I wrote the code in pari and it has been running for approximately 23 hours now, on one core of a 3.4 GHz i5 CPU. I didn't make any optimisations to reduce the runtime though, so I'm sure it's possible to search higher and faster.

So yeah, the puzzle is basically to find the next number, n, for which countdown-n is prime (or at least a probable prime).[/QUOTE]

without looking at other properties of these numbers:

[CODE]b="";for(x=1,800,b=concat(Str(x),b);if(isprime(eval(b)),print(b)))[/CODE] is a quick code in pari I made.

Batalov 2012-09-21 19:22

For the [URL="http://oeis.org/A007908"]Smarandache consecutive numbers[/URL], we have no known primes, even though...
[QUOTE]Stephan finds no primes in the first 839 terms. I checked that there are no primes in the first 5000 terms. Heuristically there are infinitely many, about 0.5 log log n through the n-th term. - C R Greathouse IV, Sep 19 2012[/QUOTE]We should heuristically expect the same for the [URL="http://oeis.org/A000422"]reverse Smarandache consecutive numbers[/URL]. Right?

Ah. There is the second one - [url]http://oeis.org/A176024[/url]

henryzz 2012-09-21 19:23

The following pfgw script should do it. I have used it to test upto 4000. The tests quickly get large enough to be using prime95's ffts. PFGW also can trial factor using the -f option. Without sieving this should be pretty much the best you can get.

[CODE]SCRIPT

DIM n, 0
DIM max_n, 10000
DIMS str
DIM tmp

LABEL next_n
SET n,n+1
SETS str,%d%s;n;str

STRTOINT tmp,str
PRP tmp
IF (n<=max_n) then GOTO next_n

LABEL end[/CODE]

edit: Assuming 0.5 log log n is right then we should expect 2 primes by n=514,843,556,263,457,213,182,265
In other words since we have found 1 at n=82 we are probably wasting our time searching.

science_man_88 2012-09-21 19:27

[QUOTE=henryzz;312316]The following pfgw script should do it. I have used it to test upto 4000. The tests quickly get large enough to be using prime95's ffts. PFGW also can trial factor using the -f option. Without sieving this should be pretty much the best you can get.

[CODE]SCRIPT

DIM n, 0
DIM max_n, 10000
DIMS str
DIM tmp

LABEL next_n
SET n,n+1
SETS str,%d%s;n;str

STRTOINT tmp,str
PRP tmp
IF (n<=max_n) then GOTO next_n

LABEL end[/CODE][/QUOTE]

one thing I thought of was that all 10^n are 4 mod 6 for all n>0 and so we can have (T(n)*4-3)%6 is the larger number mod 6 to search only when 1 or 5 mod 6 happens of course to shorten this up note 1 or 5 mod 6 happens for n=1 or 2 mod 3 cuts the search by a third.

henryzz 2012-09-21 19:29

[QUOTE=science_man_88;312318]one thing I thought of was that all 10^n are 4 mod 6 for all n>0 and so we can have (T(n)*4-3)%6 is the larger number mod 6 to search only when 1 or 5 mod 6 happens of course to shorten this up note 1 or 5 mod 6 happens for n=1 or 2 mod 3 cuts the search by a third.[/QUOTE]

Since trial division is being done by pfgw this isn't really necessary. It would at most be a very minor speed up for small numbers.

science_man_88 2012-09-21 19:37

[QUOTE=henryzz;312320]Since trial division is being done by pfgw this isn't really necessary. It would at most be a very minor speed up for small numbers.[/QUOTE]

just found an error any way because it's the multiply by 4 that needs to be 1 or 2 mod 3 so the T(n)-1 that needs to follow that.

science_man_88 2012-09-21 19:52

[QUOTE=science_man_88;312322]just found an error any way because it's the multiply by 4 that needs to be 1 or 2 mod 3 so the T(n)-1 that needs to follow that.[/QUOTE]

just found another error I'm thinking too much about double Mersenne numbers,it's 0 or 1 mod 3

kar_bon 2012-09-21 21:12

The prime for n=82 mentioned in post #1 can be found on my page [url=http://www.rieselprime.de/Others/Smarandache.htm]here[/url] in table 2.

CRGreathouse 2012-09-21 21:51

[QUOTE=henryzz;312316]Assuming 0.5 log log n is right then we should expect 2 primes by n=514,843,556,263,457,213,182,265
In other words since we have found 1 at n=82 we are probably wasting our time searching.[/QUOTE]

It's a Poisson model, so finding one shouldn't discourage you -- it doesn't count toward a quota. On the other hand,
(log(log(10^6))-log(log(37800)))/2 = 0.135...
might -- the chance of finding a prime below a million but above Eric Weisstein's search limit of 37,800 is only about 13%. (0.135 primes expected in that range, chance of none 12.6%.)

Batalov 2012-09-21 22:04

[QUOTE=henryzz;312316]edit: Assuming 0.5 log log n is right then we should expect 2 primes by n=514,843,556,263,457,213,182,265
In other words since we have found 1 at n=82 we are probably wasting our time searching.[/QUOTE]
But the collective "we" already found [URL="http://oeis.org/A176024"]two[/URL]. (see post #3, E.W.W. link)
I agree that anyone searching [URL="http://mathworld.wolfram.com/ConsecutiveNumberSequences.html"]under E.W.W.'s limit[/URL] would be wasting their time.

"An ounce of research saves a ton of ground work."


All times are UTC. The time now is 06:14.

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