![]() |
|
|
#12 | ||
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2×33×109 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 |
||
|
|
|
|
|
#13 | ||
|
Mar 2008
25 Posts |
Quote:
Quote:
|
||
|
|
|
|
|
#14 |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·33·109 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 |
|
|
|
|
|
#15 | |
|
Mar 2008
25 Posts |
Quote:
|
|
|
|
|
|
|
#16 |
|
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
22×3×17×23 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.)
|
|
|
|
|
|
#17 |
|
Nov 2003
16510 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.
|
|
|
|
|
|
#18 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·33·109 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 |
|
|
|
|
|
|
#19 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·33·109 Posts |
Quote:
also what is wrong with 5k-1 for example |
|
|
|
|
|
|
#20 | |
|
"Brian"
Jul 2007
The Netherlands
7×467 Posts |
Quote:
Nothing is wrong with numbers of the form 5k-1, 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 Brian-E on 2008-05-03 at 16:00 |
|
|
|
|
|
|
#21 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
133768 Posts |
Quote:
i have taken it to 50mil and i am gonna look for other methods of finding a solution |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Primes in n-fibonacci sequence and n-step fibonacci sequence | sweety439 | And now for something completely different | 17 | 2017-06-13 03:49 |
| Aliquot sequence convergence question | philmoore | Math | 3 | 2009-03-20 19:04 |
| A New Sequence | devarajkandadai | Math | 3 | 2007-03-20 19:43 |
| Primorial Sequence Question | grandpascorpion | Math | 2 | 2006-02-24 15:01 |
| Sequence | Citrix | Puzzles | 5 | 2005-09-14 23:33 |