![]() |
|
|
#2322 |
|
"Ed Hall"
Dec 2009
Adirondack Mtns
28·3·5 Posts |
Thanks. That would keep me from possibly losing the value. Is the first "rm oldStatus" just to "be sure" before the mv?
|
|
|
|
|
|
#2323 | |
|
"Ed Hall"
Dec 2009
Adirondack Mtns
28×3×5 Posts |
Quote:
Code:
? for(x=1000010274060000,1000010274080000,b=x;for(y=1,10000000,if((sigma(b)-b) != 0,b=sigma(b)-b);if(b==x,print(x","y);break()))) ^C *** sigma: user interrupt after 7mn, 32,978 ms. Code:
? for(b=100001027406,100001027408,c=b*10000;for(d=c,c+10000,i=d;f=d*20;for(e=1,5,i=sigma(i)-i;if(i<d,break());if(i>f,break());if(i==d,print(d);break())))) 1000010274063430 time = 8,999 ms. |
|
|
|
|
|
|
#2324 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Code:
lucas2(t,z,p,q,x)= v=[t,z];for(y=3,x,v=concat(v,p*v[y-1]-q*v[y-2]));v=vector(x,i,v[i]) Code:
for(z=-1000,1000,for(a=-1000,1000,if(lucas2(2,3,z,a,13)==[2,3,5,7,13,17,19,31,61,89,107,127,521],print(z","a)))) Last fiddled with by science_man_88 on 2011-11-08 at 15:48 |
|
|
|
|
|
#2325 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
how can it be done in PARI because if possible it may allow me to test something , I'm currently working on related to Mersenne prime exponents. because laurv talked of code like:
Code:
sqrt(Mod(2,2^61-1)) Last fiddled with by science_man_88 on 2011-11-27 at 00:38 |
|
|
|
|
|
#2326 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
trap() still not sure how to use it. Last fiddled with by science_man_88 on 2011-11-27 at 00:53 |
|
|
|
|
|
|
#2327 |
|
Aug 2006
3×1,993 Posts |
The general format is
trap(, code, what to do if the code fails) as in Code:
trap(,1/0,"don't divide by 0") |
|
|
|
|
|
#2328 | |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
Quote:
Code:
(17:34)>b=2;forprime(p=2281,2281,for(y=1,p-1,b=sqrt(Mod(b,1<<p-1));trap(,break(),);if(y==p-1,print(p)));b=2) *** sqrt: user interrupt after 13,750 ms. *** break: bug in PARI/GP (Segmentation Fault), please report *** Break loop (type 'break' or Control-d to go back to GP) |
|
|
|
|
|
|
#2329 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
Code:
(17:37)>b=2;forprime(p=29,29,for(y=1,p-1,b=sqrt(Mod(b,1<<p-1));if(y==p-1,print(p)));b=2) *** sqrt: non quadratic residue in gsqrt *** break: bug in PARI/GP (Segmentation Fault), please report *** Break loop (type 'break' or Control-d to go back to GP) |
|
|
|
|
|
|
#2330 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
hopefully I don't have to reinstall ( though likely) I've had segmentation faults too much ( stupidly ignored a little) and even my timer seems wacky at times.
|
|
|
|
|
|
#2331 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#2332 |
|
Romulan Interpreter
Jun 2011
Thailand
3·3,221 Posts |
I don't know what are you trying to do (semantically), but (syntactically) you should write this:
Code:
(10:06:27) gp > b=2;forprime(p=2,2281,for(y=1,p-1,trap(,print("break here, p="p", y="y);break,b=sqrt(Mod(b,1<<p-1)));if(y==p-1,print(p)));b=2)
break here, p=2, y=1
break here, p=3, y=2
break here, p=5, y=3
7
break here, p=11, y=6
break here, p=13, y=7
break here, p=17, y=5
break here, p=19, y=10
23
break here, p=29, y=15
31
break here, p=37, y=19
break here, p=41, y=11
break here, p=43, y=8
47
break here, p=53, y=27
Last fiddled with by LaurV on 2011-11-28 at 03:10 |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |