mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-08-15, 01:43   #496
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by science_man_88
what as a prime or as a Mersenne number ?
Use your snippets to show that it is a prime Mersenne number.
3.14159 is offline   Reply With Quote
Old 2010-08-15, 01:59   #497
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Use your snippets to show that it is a prime Mersenne number.
well 127-3 = 124 124/2 = 62 so index 62 of 002450 will be a number

the question becomes will that be a number contained in px+c.

p in this case seems to be a possible factor of 2^z-1.

find when it hits px+c. determine px+c from finding c as the first time 6np+/-p intersects 24m+7. in the case of a prime we would have to find a faster way as you'd have to check every possible factor 2kz+1<sqrt(2^z-1)
science_man_88 is offline   Reply With Quote
Old 2010-08-15, 13:07   #498
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

sorry only have to check primes of form 2kz+1<sqrt(2^z-1)
science_man_88 is offline   Reply With Quote
Old 2010-08-15, 15:03   #499
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quick pondering: I wanted to make a quick program that would generate k's for k * n! + 1 that would give a certain prime divisor, along with a prime-numbered cofactor.
I have everything set.. But the only issue I have is: How to grab that Mod number..

Ex: Mod(-1, 71)/11! = 51
51 * 11! + 1 is divisible by 71.

PARI is only able to give it in the form Mod(51, 71).

Everything else (the forstep, etc.) is pretty much set, what hinders me is pretty much how to obtain the Mod number alone besides handwork.

Is there a way to get the Mod number on its own? Why didn't they simply do this instead:

>Mod(-1, 71)/(11!)
%1 = 51

Last fiddled with by 3.14159 on 2010-08-15 at 15:06
3.14159 is offline   Reply With Quote
Old 2010-08-15, 15:32   #500
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
How to grab that Mod number.
lift() is what you want. Also of interest is centerlift().

Quote:
Originally Posted by 3.14159 View Post
Why didn't they simply do this instead:

>Mod(-1, 71)/(11!)
%1 = 51
Because the correct answer is the set of numbers of the form 51 + 71k, which includes more than just 51. Also, pragmatically, it's common for further calculations to use the intmod rather than just its lift over the integers.
CRGreathouse is offline   Reply With Quote
Old 2010-08-15, 15:59   #501
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

is there a TeX to Pari and vice versa converter there should be lol but then again it would be quick large again lol why do i come up with ideas that seem never able to be realized lol.
science_man_88 is offline   Reply With Quote
Old 2010-08-15, 16:05   #502
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
is there a TeX to Pari and vice versa converter there should be lol but then again it would be quick large again lol why do i come up with ideas that seem never able to be realized lol.
There's the Pari command Strtex, which works passably well:
Code:
Strtex((x-2)^6)
%1 = "x^6\n - 12 x^5\n + 60 x^4\n - 160 x^3\n + 240 x^2\n - 192 x\n + 64"
CRGreathouse is offline   Reply With Quote
Old 2010-08-15, 16:10   #503
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

@CRG: I tried an example: Find multiples of 30! which have 727 as a smallest divisor, and a prime cofactor:

It only circularly printed 727.

Here is the code snippet:

Code:
em(x,n,a,b)=lift(Mod(-1,x)/(n));forstep(b=(lift(Mod(-1,x)/(n))),10^(a),x,if(isprime((b*n+1)/x), print(x)))
My guess is that it treats this section as "equal to 727": b=(lift(Mod(-1,x)/(n))),10^(a)

Let's see what happens when I change it to: b==(lift(Mod(-1,x)/(n))),10^(a). (Syntax error.)

Last fiddled with by 3.14159 on 2010-08-15 at 16:14
3.14159 is offline   Reply With Quote
Old 2010-08-15, 16:18   #504
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
There's the Pari command Strtex, which works passably well:
Code:
Strtex((x-2)^6)
%1 = "x^6\n - 12 x^5\n + 60 x^4\n - 160 x^3\n + 240 x^2\n - 192 x\n + 64"
for me:

Code:
(13:16) gp > Strtex(sum(x=0,101,x))
%27 = "5151"
doesn't seem to cut it.
science_man_88 is offline   Reply With Quote
Old 2010-08-15, 16:23   #505
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
for me:

Code:
(13:16) gp > Strtex(sum(x=0,101,x))
%27 = "5151"
doesn't seem to cut it.
sum(x=0,101,x) is 5151, so that's all that Strtex ever sees. Strtex can't tell what created the 5151.

And I'm sure it's not smart enough to deal with functions. Let me check...
Code:
Strtex(n->sum(x=0,n,x))
%1 = "(n)\\mapsto sum(x=0,n,x)"
Huh... not what I expected. So it can handle them in some weak sense, but it doesn't know how to translate Pari functions.
CRGreathouse is offline   Reply With Quote
Old 2010-08-15, 16:26   #506
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Hmm.. I finally got it to print something, but it's all incorrect.

Last fiddled with by 3.14159 on 2010-08-15 at 16:27
3.14159 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:58.


Fri Aug 6 22:58:06 UTC 2021 up 14 days, 17:27, 1 user, load averages: 4.13, 4.17, 4.02

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.