mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2011-01-21, 00:17   #23
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5·271 Posts
Default

I didn't see your post, so I don't know what you said. However, instead of finding the number of primes less than 10^4 and multiplying by 10^12, you could have found the number of primes less than 10^16:
http://en.wikipedia.org/wiki/Prime-counting_function

pi(10^16) = 279,238,341,033,925

279 trillion versus 1.23 quadrillion.
lavalamp is offline   Reply With Quote
Old 2011-01-21, 00:41   #24
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22×7×53 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
If we "forget" that the card is prime, but other 3 requirements are true, then it is easy to calculate this number:
Code:
s=0;forprime(p=2,10^8,s+=isprime(p%10000));return(s*10^7)
17673550000000
It wouldn't be terrible to calculate the answer for the original puzzle: For this fix p, where 0<p<10^8 prime and p%10000 is also prime. Then sieve p+10^8*i for 0<=i<10^8 so in a remainder class, this is quite good, since that's 10^8 numbers and we have to sieve by primes up to sqrt(10^16)=10^8. For each q=p+i*10^8 prime check if it is a valid card for Luhn alg.

For p there are 1767355 choices, it means that we have to sieve out only about 1.7*10^14 numbers, instead of 10^16.

Last fiddled with by R. Gerbicz on 2011-01-21 at 00:42
R. Gerbicz is offline   Reply With Quote
Old 2011-01-21, 00:47   #25
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 didn't see your post, so I don't know what you said. However, instead of finding the number of primes less than 10^4 and multiplying by 10^12, you could have found the number of primes less than 10^16:
http://en.wikipedia.org/wiki/Prime-counting_function

pi(10^16) = 279,238,341,033,925

279 trillion versus 1.23 quadrillion.
Yeah. I was going off the prime <10^4 because the last 4 digits must form a prime and just knowing how many primes there are under 10^16 may have got me closer but I'd still have to eliminate based on which ones ended in a 4 digit prime (including leading 0's for smaller amounts)
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 03:05   #26
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5×271 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
For p there are 1767355 choices
Ah, I got 112 higher, but now I remember it's because the upper limit in a pari/gp for loop is inclusive and I ran an outer loop from 0 to 10000.
Code:
{

n=0;

for(a=0,9999,
  forprime(p=2,9999,
    if(isprime(a*10000+p),n++)
  )
);

print(n);

}
As for the sieve, I wouldn't call 1.7*10^14 candidates "only". Even after sieveing out composites there will still be several billion candidates remaining (admittedly lower than the 800 billion I took a stab at earlier).

Anyone have an off-the-shelf segmented sieve they feel like running these numbers through?
lavalamp is offline   Reply With Quote
Old 2011-01-21, 04:10   #27
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2×3×7×233 Posts
Default

Quote:
Originally Posted by ixfd64 View Post
Man, I could see the headlines already...
"MersenneForum fully funded through 2197."
Uncwilly is online now   Reply With Quote
Old 2011-01-21, 05:11   #28
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103×113 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
"MersenneForum fully funded through 2197."
Does that mean my impending "financially wrenching" experience would at least be tax-deductible?
ewmayer is offline   Reply With Quote
Old 2011-01-21, 05:33   #29
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

100000001000002 Posts
Default

Imagine all of the Hoff memorabilia we could buy!

Xyzzy is offline   Reply With Quote
Old 2011-01-21, 13:40   #30
Flatlander
I quite division it
 
Flatlander's Avatar
 
"Chris"
Feb 2005
England

31×67 Posts
Default

Maybe we should ask him how much credit he has left before we hit him over the head ... I mean, calculate the number.
Flatlander is offline   Reply With Quote
Old 2011-01-21, 17:58   #31
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

5×271 Posts
Default

I don't know how much it would narrow down the search, but from the looks of it Ernst checked the primality of the rightmost numbers on his credit card in batches of 4, so that in all likelyhood, the rightmost 12-digit portion is NOT prime.

Of course he may have checked them in batches of 2^n from n = 2 to 4, but since they are grouped into 4 batches of 4, this seems less likely.
lavalamp is offline   Reply With Quote
Old 2011-01-21, 18:48   #32
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

1) let Z be the primes.
2) let Y be the numbers less than 10 000
3) we can define the set X to be the subset of Y\cap Z
4) let A be the set of 8 digit numbers with {last 4 digits}\in X
5)we let B become the subset of A where A\cap Z
6) we make new sets C D and E, where C is the set of 16 digits card numbers, D is where C conforms to{last 8 digits}\in A, and E is where D\cap Z

if \cap means intersect, then my logic points me in the direction that what we are solving for is how many elements in E pass the Luhn-algorithm checksum.

is my logic even close to accurate ?
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 19:53   #33
davar55
 
davar55's Avatar
 
May 2004
New York City

2×29×73 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Science_man, of you can't be bothered to even read up on the most elementary aspects of number theory, just STFU, will you?

Good grief, that was some unbelievably stupid shit there. I had to delete it simply to keep this from turning into another 100-post flamefest between you and Bob Silverman.
Deleted before I read it.

I keep missing the "fun" (disruption isn't really fun).

Could someone fill me in?
davar55 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" wildrabbitt Miscellaneous Math 11 2015-03-06 08:17
AMD Announces Industry's First "Supercomputing" Server Graphics Card ET_ GPU Computing 23 2013-11-18 17:49
Speeding up double checking when first test returns "prime" Unregistered PrimeNet 16 2006-02-28 02:00
Oh noes! The "42nd Mersenne prime" isn't prime! ixfd64 Lounge 7 2005-04-03 19:27
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 03:53.


Sat Jul 17 03:53:54 UTC 2021 up 50 days, 1:41, 1 user, load averages: 1.81, 1.89, 1.75

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.