mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2012-09-21, 18:42   #1
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5·271 Posts
Default 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).
lavalamp is offline   Reply With Quote
Old 2012-09-21, 18:58   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by lavalamp View Post
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).
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)))
is a quick code in pari I made.
science_man_88 is offline   Reply With Quote
Old 2012-09-21, 19:22   #3
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36×13 Posts
Default

For the Smarandache consecutive numbers, 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
We should heuristically expect the same for the reverse Smarandache consecutive numbers. Right?

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

Last fiddled with by Batalov on 2012-09-21 at 19:23
Batalov is offline   Reply With Quote
Old 2012-09-21, 19:23   #4
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

133708 Posts
Default

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
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.

Last fiddled with by henryzz on 2012-09-21 at 19:27
henryzz is online now   Reply With Quote
Old 2012-09-21, 19:27   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by henryzz View Post
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
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.
science_man_88 is offline   Reply With Quote
Old 2012-09-21, 19:29   #6
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

23·3·5·72 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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.
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.
henryzz is online now   Reply With Quote
Old 2012-09-21, 19:37   #7
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by henryzz View Post
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.
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.

Last fiddled with by science_man_88 on 2012-09-21 at 19:45
science_man_88 is offline   Reply With Quote
Old 2012-09-21, 19:52   #8
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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.
just found another error I'm thinking too much about double Mersenne numbers,it's 0 or 1 mod 3
science_man_88 is offline   Reply With Quote
Old 2012-09-21, 21:12   #9
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

23·3·112 Posts
Default

The prime for n=82 mentioned in post #1 can be found on my page here in table 2.
kar_bon is offline   Reply With Quote
Old 2012-09-21, 21:51   #10
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by henryzz View Post
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.
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%.)
CRGreathouse is offline   Reply With Quote
Old 2012-09-21, 22:04   #11
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

250516 Posts
Default

Quote:
Originally Posted by henryzz View Post
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.
But the collective "we" already found two. (see post #3, E.W.W. link)
I agree that anyone searching under E.W.W.'s limit would be wasting their time.

"An ounce of research saves a ton of ground work."
Batalov is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Countdown to Zero. jwaltos Science & Technology 2 2016-12-29 00:19
The 2012 countdown fivemack Factoring 2 2011-12-22 08:08
Countdown meter gd_barnes No Prime Left Behind 14 2010-12-07 11:55
Best countdown problem ever davieddy Puzzles 22 2009-01-26 13:46
Prime Countdown Orgasmic Troll Lounge 7 2007-09-22 01:24

All times are UTC. The time now is 10:57.


Sat Jul 17 10:57:01 UTC 2021 up 50 days, 8:44, 1 user, load averages: 1.01, 1.14, 1.25

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.