mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-14, 02:27   #430
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

168010 Posts
Default

Quote:
Originally Posted by CRGreathouse
I must be interpreting you the wrong way, then, since I find 17 million instances below 1020:
No, sm88 was searching from 1 to 1020

Also: I can rig the number to be semiprime: Here's an example:

Code:
55762113159666605738616781764882446662982216262889524965004140441546022418664991294967299112901478710275915859674894915215729565500652173245752458035579997432840192000000000000000000000001 = 5846650401949673788584832661 * 9537446114628590934543506256858833034627998057578048449114232547066222757945489740614277575764557950018685132240750168209560234946900002547179019523457586506941
It's rather cool what you can do with modular exponentiation.

Here's a better example:
Code:
289508238708400855287326405336918749133423298889334502223156944093968*150!+1 = 10254288128120939058918287267226262277004901802104088101537671807691 * 1613053686056875801829683444255478970299912076335944456541386114240383845905441917746506601556683535279149882320681534772255292138166095487502436596518188053218548567074676625073642723441629113007713095460989964369203609983928686506798110902140688105800120704029411
See? I just made a record! (Imagine someone was in the middle of factoring that one.)

Last fiddled with by 3.14159 on 2010-08-14 at 02:42
3.14159 is offline   Reply With Quote
Old 2010-08-14, 03:22   #431
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
And you would have continued checking for another few thousand years, because it's in the 10^20 range.
He would have hit an instance in a few hours, and a prime instance in a few days, if I calculate correctly. Of course they wouldn't be close to 10^20.
CRGreathouse is offline   Reply With Quote
Old 2010-08-14, 12:25   #432
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
M(x)= a=0;for(n=0,x-1,a=a+M(n));a=a+x;print(a",")
best i can do in coding my equation.
science_man_88 is offline   Reply With Quote
Old 2010-08-14, 14:08   #433
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

168010 Posts
Default

Quote:
Originally Posted by CRGreathouse
If you wanted k to be a prime, then
Ah: But if you want the cofactor to be prime:

Code:
forstep(n=1,a,b,if(isprime((n*22!+1)/b), print(n)))
Here's an example:
2386628800 * 60! + 1 = 894 * 316518937978282424919538194794587561257209063707380372243938125981964972473329411361

Ex 2:
1974103215468915131950479405951082163*66!+1 = 716 * 894 * 1018 *
12347042307394672596544859365776765192013890088140194548358364707496516846616209505096123905841

Last fiddled with by 3.14159 on 2010-08-14 at 14:22
3.14159 is offline   Reply With Quote
Old 2010-08-14, 14:36   #434
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

I know for n>2 MP(n) = 4^k*MP(n-1)+(4^k-1) the hard part is how to define k.

Last fiddled with by science_man_88 on 2010-08-14 at 14:36
science_man_88 is offline   Reply With Quote
Old 2010-08-14, 14:56   #435
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

only problem with my codes is deep recursion I think it's called.
science_man_88 is offline   Reply With Quote
Old 2010-08-14, 15:04   #436
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

I think if i change it to vectors then ask for the sum of the indexes it might work. but it's never a guarantee with me lol.
science_man_88 is offline   Reply With Quote
Old 2010-08-14, 17:40   #437
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
M(x)= a=0;for(n=0,x-1,a=a+M(n));a=a+x;print(a",")
best i can do in coding my equation.
Did you mean to return the a, rather than printing it?
CRGreathouse is offline   Reply With Quote
Old 2010-08-14, 17:42   #438
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
only problem with my codes is deep recursion I think it's called.
I'm not sure if the program does what it's intended. If so, then the answer is what you hint at below: memoize the result.

Quote:
Originally Posted by science_man_88 View Post
I think if i change it to vectors then ask for the sum of the indexes it might work. but it's never a guarantee with me lol.
CRGreathouse is offline   Reply With Quote
Old 2010-08-14, 17:53   #439
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Did you mean to return the a, rather than printing it?
I've tried both neither give a correct answer for me.
science_man_88 is offline   Reply With Quote
Old 2010-08-14, 18:01   #440
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I've tried both neither give a correct answer for me.
I can't correct the program because I don't know what it's trying to do. But certainly the program isn't doing what you intend if it stores the value it returns but doesn't actually return a value.
CRGreathouse is offline   Reply With Quote
Reply



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

All times are UTC. The time now is 22:48.


Fri Aug 6 22:48:24 UTC 2021 up 14 days, 17:17, 1 user, load averages: 4.21, 4.24, 3.91

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.