mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2011-02-09, 07:29   #23
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36·13 Posts
Default

n=270, a prp11150 - attached.
Attached Files
File Type: zip prp11150.zip (5.7 KB, 119 views)
Batalov is offline   Reply With Quote
Old 2011-02-09, 08:25   #24
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

100101000001012 Posts
Default

a prp15046 (n=314)
Attached Files
File Type: zip prp15046.zip (8.8 KB, 126 views)
Batalov is offline   Reply With Quote
Old 2011-02-09, 15:43   #25
axn
 
axn's Avatar
 
Jun 2003

13BB16 Posts
Default

Quote:
Originally Posted by retina View Post
swapsies, even <---> odd.
Indeed. I was, of course, referring to the number of terms. Yeah, that's the ticket.
axn is offline   Reply With Quote
Old 2011-02-09, 16:01   #26
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

well one thing the amount of primes depends on is how many permutations that end in 1 there are. since 1=2^0 we can use n! to figure out how many permutations there are of the remaining elements. as for if they are prime I haven't got that far.
science_man_88 is offline   Reply With Quote
Old 2011-02-09, 18:57   #27
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
well one thing the amount of primes depends on is how many permutations that end in 1 there are. since 1=2^0 we can use n! to figure out how many permutations there are of the remaining elements. as for if they are prime I haven't got that far.
I discuss this in post #16. There are (n-1)! permutations that result in a number coprime to 10, making the 'chance' that an individual number is prime about 2.5 times more likely than a standard number that size, which is ~ 1/log(2^(n^2)). Thus the expected number of primes is something like 2.5 * n! / log 2 / n^3.

Last fiddled with by CRGreathouse on 2011-02-09 at 18:58
CRGreathouse is offline   Reply With Quote
Old 2011-02-09, 19:11   #28
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I discuss this in post #16. There are (n-1)! permutations that result in a number coprime to 10, making the 'chance' that an individual number is prime about 2.5 times more likely than a standard number that size, which is ~ 1/log(2^(n^2)). Thus the expected number of primes is something like 2.5 * n! / log 2 / n^3.
couldn't we use PARI for small ones ? the hard part in my eyes is making sure we do every permutation without recording them as we go.
science_man_88 is offline   Reply With Quote
Old 2011-02-09, 19:15   #29
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22×1,549 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
The numbers are something like n2/2 + O(n) bits long and there are (n-1)! ways to order them with the 1 in the rightmost position. The 'chance' that one would be prime is about 2.5 log 2 / n2, so the expected number of primes is very large -- superexponential.
I don't understand why it is (n-1)!. Is it not n!. We exclude 2^0 then that leaves n sets of numbers to permute, 2^1 to 2^n.

Last fiddled with by retina on 2011-02-09 at 19:16
retina is online now   Reply With Quote
Old 2011-02-09, 20:25   #30
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Code:
(13:29)>p2=vector(100,n,sumdigits(2^n))
%21 = [2, 4, 8, 7, 5, 1, 2, 4, 8, 7, 5, 1, 2, 4, 8, 7, 5, 1, 2, 4, 8, 7, 5, 1, 2, 4, 8, 7, 5, 1, 2, 4,
(15:12)>x6=vector(100,x,sumdigits(6*x+1))
%22 = [7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4, 1, 7, 4,
(15:12)>x6=vector(100,x,sumdigits(6*x-1))
%23 = [5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2, 8, 5, 2,
adding 1 as the first in p2 we can show that only indexes 2x+1 starting at the 1 added in can have possible primes.

1 fits into the 1,2,4,5,7,8
1+2=3 doesn't fit in
1+2+4 = 7 fits
1+2+4+8 = 15(1+5) = 6 doesn't
1+2+4+8+7 = 22(2+2) = 4 fits
1+2+4+8+7+5 = 27 = 0 doesn't

the pattern repeats.
science_man_88 is offline   Reply With Quote
Old 2011-02-09, 20:28   #31
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by retina View Post
I don't understand why it is (n-1)!. Is it not n!. We exclude 2^0 then that leaves n sets of numbers to permute, 2^1 to 2^n.
It's all in how you count it: is #88 2^0 through 2^88 or 2^0 through 2^87? The conversion to the other convention is obvious.
CRGreathouse is offline   Reply With Quote
Old 2011-02-09, 20:30   #32
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
couldn't we use PARI for small ones ? the hard part in my eyes is making sure we do every permutation without recording them as we go.
I used it to get this thing started, with
Code:
try(n)=my(t);n--;for(k=1,n!,if(ispseudoprime(t=glue(round(2^numtoperm(n,k)))*10+1),return(t)))
I didn't try to find any large values with this, though -- PARI's not well-suited to probable-prime testing numbers beyond 1000-2000 digits.
CRGreathouse is offline   Reply With Quote
Old 2011-02-09, 20:38   #33
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

250516 Posts
Default

I used perl to manipulate strings (pregenerated with BigInt), sans '1'. With an array of strings, just swap two random strings at a time, concat (with '1' at end) and pipe into pfgw. Just my 2c.
Batalov is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Digit strings containing primes davar55 Puzzles 13 2018-03-15 14:46
Sieving with powers of small primes in the Small Prime variation of the Quadratic Sieve mickfrancis Factoring 2 2016-05-06 08:13
Bashing Strings Parsimoniously in Linux EdH Programming 15 2013-05-06 11:04
ubasic question - strings Andi47 Programming 5 2008-12-28 05:52
Strings of Digits davar55 Puzzles 5 2008-11-02 00:08

All times are UTC. The time now is 19:13.


Fri Jul 16 19:13:59 UTC 2021 up 49 days, 17:01, 1 user, load averages: 1.90, 2.09, 2.57

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.