![]() |
|
|
#111 |
|
Aug 2006
10111010110112 Posts |
|
|
|
|
|
|
#112 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
6mn, 1,812 ms for 40 million ? 156 ms for 40000 1907 for 400,000 29,281 ms. for 4 million Last fiddled with by science_man_88 on 2010-07-21 at 20:18 |
|
|
|
|
|
|
#113 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
wow 77-78 posts in one day ?
|
|
|
|
|
|
#114 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Code:
Goldbach(n)={
my(nn=n+n);
forprime(x=2,n,if(isprime(nn-x),return(x)));
0
};
GoldbachMax(n)={
my(nn=n+n);
forprime(x=2,default(primelimit),if(isprime(nn-x),return(x)));
error("Ran out of primes at "n)
};
test(lim)={
for(n=2,min(lim\2,default(primelimit)),
if(Goldbach(n),print1(2*n,","))
);
for(n=min(lim\2,default(primelimit))+1,lim\2,
if(GoldbachMax(n),print1(2*n,","))
)
};
test(4000)
|
|
|
|
|
|
#115 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#116 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
test(x) does all test up to x if we've already done them is there a way we could give that information to the code ?
Last fiddled with by science_man_88 on 2010-07-21 at 23:59 |
|
|
|
|
|
#117 | |
|
Aug 2006
135338 Posts |
Quote:
Code:
test(lim,startAt=2)={
my(breakpoint=min(lim\2,default(primelimit)));
startAt=floor(startAt);
for(n=startAt,breakpoint,
if(Goldbach(n),print1(2*n,","))
);
for(n=max(startAt,breakpoint+1),lim\2,
if(GoldbachMax(n),print1(2*n,","))
)
};
Code:
test(10000,4000) |
|
|
|
|
|
|
#118 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Code:
(21:35) gp > test(lim,startAt=2)={
my(breakpoint=min(lim\2,default(primelimit)));
startAt=floor(startAt);
for(n=startAt,breakpoint,
if(Goldbach(n),print1(2*n,","))
);
for(n=max(startAt,breakpoint+1),lim\2,
if(GoldbachMax(n),print1(2*n,","))
)
};
(21:35) gp > test(4000,4)
*** for: not a function: `Goldbach'.
I figured one problem out. Now it seems to start at twice my low bound. don't worry about the syntax like that if I truly do learn Asm more I'll have to get used to things like that lol Last fiddled with by science_man_88 on 2010-07-22 at 00:45 |
|
|
|
|
|
#119 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#120 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
|
|
|
|
|
|
#121 | |
|
Aug 2006
3·1,993 Posts |
Quote:
My standard file of the gp scripts I load every session (not including my old.gp and various specialized .gp files) is probably 20 pages long. It's not something you'd want to enter manually each time. |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Goldbach Conjecture | MattcAnderson | MattcAnderson | 4 | 2021-04-04 19:21 |
| Factorial and Goldbach conjecture. | MisterBitcoin | MisterBitcoin | 17 | 2018-01-29 00:50 |
| Goldbach's weak conjecture | MattcAnderson | MattcAnderson | 19 | 2017-03-21 18:17 |
| Goldbach's conjecture | Citrix | Puzzles | 3 | 2005-09-09 13:58 |