mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2011-01-21, 21:01   #34
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103×113 Posts
Default

Quote:
Originally Posted by davar55 View Post
Deleted before I read it.

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

Could someone fill me in?
Alright, alright ... I undeleted the 2 posts in question. Like I said, it was really my fault for not respecting the "ignore user" I placed on sm88 last year. My ignorance of his repeated putting-on-display of his own ignorance was bliss, but then curiosity demised the metaphorical feline, or something.
ewmayer is offline   Reply With Quote
Old 2011-01-21, 21:04   #35
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

I've got a code working to check the luhn test. now it's checking through the 16 digits primes that have the last 8 digits a prime that have the last 4 digits a prime.
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 21:07   #36
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I've got a code working to check the luhn test. now it's checking through the 16 digits primes that have the last 8 digits a prime that have the last 4 digits a prime.
Why don't you just check 1000000000000000 through 1000001000000000 and tell us how long that takes? That way you'll have a good idea of how long the whole thing will take (about a million times longer).
CRGreathouse is offline   Reply With Quote
Old 2011-01-21, 21:15   #37
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Why don't you just check 1000000000000000 through 1000001000000000 and tell us how long that takes? That way you'll have a good idea of how long the whole thing will take (about a million times longer).
I know I'm a crappy idea major lol.
Code:
(17:09)>a=0;forstep(x=1000000000000001,1000000000100001,2,if(isprime(x) && luhn(x),a=a+1));print(a)
82
(17:11)>a=0;forstep(x=1000000000000001,1000000000100001,2,if(isprime(x) && isprime(x%10^8) &&luhn(x),a=a+1));print(a)
84
This shouldn't happen! and it returned the 2 numbers on the test site perfectly to spec. Sorry crossed a control variable.

Last fiddled with by science_man_88 on 2011-01-21 at 21:20
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 21:36   #38
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
(17:19)>b=0;forstep(x=1000000000000001,1000000000100001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
22
(17:20)>##
  ***   last result computed in 5,000 ms.
(17:21)>b=0;forstep(x=1000000000000001,1000000001000001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
126
(17:22)>##
  ***   last result computed in 51,875 ms.
(17:22)>b=0;forstep(x=1000000000000001,1000000010000001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
1019
(17:32)>##
  ***   last result computed in 8mn, 48,719 ms.
what does this tell you ?
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 21:46   #39
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103·113 Posts
Default

Quote:
Originally Posted by lavalamp View Post
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.
This opens up another interesting avenue for winnowing candidates: Let's assume for the sake of argument that for the mystery 16-digit number N, I checked the primality of (N mod (10^d)) for d = 1,2,3,...,16, and those d-values I reported as yielding a prime are the only ones. (That's not what I did for my card number, but ... I could be lying. ;) How much would knowledge of the prime/not-prime status of all 16 power-of-10 residues narrow the list of possibilities?
ewmayer is offline   Reply With Quote
Old 2011-01-21, 22:25   #40
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by ewmayer View Post
This opens up another interesting avenue for winnowing candidates: Let's assume for the sake of argument that for the mystery 16-digit number N, I checked the primality of (N mod (10^d)) for d = 1,2,3,...,16, and those d-values I reported as yielding a prime are the only ones. (That's not what I did for my card number, but ... I could be lying. ;) How much would knowledge of the prime/not-prime status of all 16 power-of-10 residues narrow the list of possibilities?
your new idea has made me see a flaw in my code (no big surprise). That's I test the last eight digits before the last 4. If the last 4 isn't prime I'm wasting time.
science_man_88 is offline   Reply With Quote
Old 2011-01-21, 22:28   #41
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
(17:19)>b=0;forstep(x=1000000000000001,1000000000100001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
22
(17:20)>##
  ***   last result computed in 5,000 ms.
(17:21)>b=0;forstep(x=1000000000000001,1000000001000001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
126
(17:22)>##
  ***   last result computed in 51,875 ms.
(17:22)>b=0;forstep(x=1000000000000001,1000000010000001,2,if(isprime(x) && isprime(x%10^8) && isprime(x%10^4) && luhn(x),b=b+1));print(b)
1019
(17:32)>##
  ***   last result computed in 8mn, 48,719 ms.
what does this tell you ?
You're going to 10^15 and it took you 8:48.719 to get to 10^7. Your expected completion time is (10^15 / 10^7) * 8:48.719 or 1675 years. Get comfy.
CRGreathouse is offline   Reply With Quote
Old 2011-01-21, 22:30   #42
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103·113 Posts
Default

Ah, the return of blissful stillness:
Attached Thumbnails
Click image for larger version

Name:	quiet.png
Views:	166
Size:	3.2 KB
ID:	6094  
ewmayer is offline   Reply With Quote
Old 2011-01-21, 22:34   #43
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by ewmayer View Post
This opens up another interesting avenue for winnowing candidates: Let's assume for the sake of argument that for the mystery 16-digit number N, I checked the primality of (N mod (10^d)) for d = 1,2,3,...,16, and those d-values I reported as yielding a prime are the only ones. (That's not what I did for my card number, but ... I could be lying. ;) How much would knowledge of the prime/not-prime status of all 16 power-of-10 residues narrow the list of possibilities?
I had the same thought. Most of the advantage is gained with the small numbers; there are only 118,443 candidates mod 10^8 rather than 1,767,355.
CRGreathouse is offline   Reply With Quote
Old 2011-01-21, 22:37   #44
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I'd think more than that. If the 16-digit number is prime, then the last digit is relatively prime to 10*, so the odds improve by a factor of ~ (5/2)^2.

* 0000000000000002 and 0000000000000005 fail the Luhn test.
Neither of these are 16 digit numbers!! They are 1 digit numbers.

They are however, 16 digit digit STRINGS.

Ernst did say "number", not "string". The most significant digit of a number
is non-zero.
R.D. Silverman 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:47 UTC 2021 up 50 days, 1:41, 1 user, load averages: 1.88, 1.90, 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.