20080428, 06:23  #12  
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts 
Quote:
according to my dad who is a professional programer it is super quick Quote:
i would have to use a bitarray to try that method i will try this tonight with booleans first and the slightly slower but lots less memory using bitarray 

20080428, 08:25  #13  
Mar 2008
2^{5} Posts 
Quote:
Quote:


20080428, 16:39  #14 
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts 
not in .net
the diferences are: bitArrays uses a huge amount less memory(i have experience of this) when debuging u cant view the values of a bitArray but u can with booleans it is possible to just change the declaration and it will work so debugging and memory are the only diffences 
20080428, 19:26  #15  
Mar 2008
32_{10} Posts 
Quote:


20080429, 22:36  #16 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
5×911 Posts 
Exactly, without getting into programming language semantics I simply meant a structure where each bit represents Y or N (has the corresponding number shown up yet...or has it not.)

20080430, 08:00  #17 
Nov 2003
245_{8} Posts 
Personally, I wouldn't bother with the bit array at all, but rather just stop checking once a number smaller than I started with is reached. If you start at 3 and go up, you are assured to be correct (in small tests this gives a speed up of a factor of ~5). Also, only bother checking with starting primes of the form 6k  1, as primes of the form 6k +1 go straight back to a number bounded by 4k + 1 in two steps. Since this is really a question about Sophie Germain primes and Cunningham chains, any knowledge from there would apply directly here.

20080430, 15:37  #18  
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
1011010111110_{2} Posts 
[quote=nfortino;132429]Personally, I wouldn't bother with the bit array at all, but rather just stop checking once a number smaller than I started with is reached. quote]
i am already doing that Quote:
i am in the process of speeding up the factoring and that seems to be using most of the time so that may help a lot 

20080503, 08:23  #19  
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts 
Quote:
also what is wrong with 5k1 for example 

20080503, 15:38  #20  
"Brian"
Jul 2007
The Netherlands
7·467 Posts 
Quote:
Nothing is wrong with numbers of the form 5k1, but nfortino is suggesting that you specifically consider the numbers modulo 6 because only the case of 5 mod 6 needs to be checked each time. Last fiddled with by BrianE on 20080503 at 16:00 

20080503, 16:02  #21  
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts 
Quote:
i have taken it to 50mil and i am gonna look for other methods of finding a solution 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Primes in nfibonacci sequence and nstep fibonacci sequence  sweety439  And now for something completely different  17  20170613 03:49 
Aliquot sequence convergence question  philmoore  Math  3  20090320 19:04 
A New Sequence  devarajkandadai  Math  3  20070320 19:43 
Primorial Sequence Question  grandpascorpion  Math  2  20060224 15:01 
Sequence  Citrix  Puzzles  5  20050914 23:33 