mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2011-10-27, 21:11   #23
gd_barnes
 
gd_barnes's Avatar
 
May 2007
Kansas; USA

101·103 Posts
Default

Quote:
Originally Posted by Batalov View Post
Well, 2^(2^n)-k sieve in k should be an appallingly easy sieve to write from scratch and even without GMP (raising 2^(2^n) mod p is very easy and then just zero some bits), but will it do better than a "sieve" like this?

Code:
# gp -p 80000000
write("kcan","ABC 2^65536-$a")
forstep(k=17,99999999,12, \
   if(k%60==17||k%60==29||k%60==53, \
   m=1;forprime(p=7,80000000,if(lift(Mod(2,p)^65536-k)<2,m=0;break)); \
   if(m>0,write("kcan",k))) \
)
and after a bit of time start "pfgw -f0 -llog kcan" in parallel?
Is this PARI code? I don't have PARI and am not familiar with it.
gd_barnes is offline   Reply With Quote
Old 2011-10-27, 22:00   #24
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

24×593 Posts
Default

Yes, it is. It is an invaluable tool and is easy to install (not as easy to use, but that's a different story; however, there are experts here on forum who will help). But this is only for prototyping.

I am sure that a plain C 50-liner siever will take care of the problem much easier and faster. I'll probably give it a crack over weekend. One could use the k%60==17||k%60==29||k%60==53 packing in it (or even tighter), or rather I am inclined to just keep only 1 (mod 12) 2Gb byte array (for k<24G) and then clear proper, equally spaced bytes relentlessly for each p until 2^32 or until too bored.
Batalov is offline   Reply With Quote
Old 2011-10-28, 18:30   #25
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

224208 Posts
Default

Quick'n'dirty... and lazy (no bit packing or any fancy stuff) and limited to sieving to 2B. Attached. Can be vastly improved (but of course Geoff could write a totally superior sieve with his left foot in 15 minutes).
Attached Files
File Type: txt sieveSafe.c.txt (1.3 KB, 111 views)

Last fiddled with by Batalov on 2011-10-28 at 18:39 Reason: 2B or not 2B
Batalov is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sieving for CRUS rebirther Conjectures 'R Us 638 2021-06-15 07:55
Sieving Drive all base 2/4 k's worked by CRUS gd_barnes Conjectures 'R Us 143 2014-10-21 23:55
Some CRUS stats vmod Conjectures 'R Us 213 2014-02-28 21:23
What are your CRUS plans? rogue Conjectures 'R Us 35 2013-11-09 09:03
how high will CRUS go Mini-Geek Conjectures 'R Us 1 2010-11-08 20:50

All times are UTC. The time now is 08:52.


Tue Jul 27 08:52:23 UTC 2021 up 4 days, 3:21, 0 users, load averages: 1.61, 1.60, 1.59

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.