mersenneforum.org  

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

Reply
 
Thread Tools
Old 2011-02-11, 22:03   #2179
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
Can you prove that it behaves the way you expect mod 7? Mod 3? Mod 4?
Code:
for(n=1,100,for(x=1,#MeVec,print1(M(x,n)","));print("::"n))
the code I showed to prime95 was :

Code:
(11:01)>for(n=1,#mersenne1,print((2^mersenne1[n]-1)%n))
0
1
1
3
1
1
1
7
1
1
6
7
5
1
7
15
1
1
12
7
10
1
15
7
1
1
1
3
26
1
1
31
7
7
31
31
31
31
1
7

Last fiddled with by science_man_88 on 2011-02-11 at 22:06
science_man_88 is offline   Reply With Quote
Old 2011-02-12, 01:06   #2180
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Can you prove that it behaves the way you expect mod 7? Mod 3? Mod 4?
what the valuation code if so no not really, I can't even find a use of valuation because I have no idea what it does.

it can't act modulo( checked with second argument as 3) so I'm stumped, oh never mind I think I realize which valuation it's talking of after going through :

http://en.wikipedia.org/wiki/Valuation_(mathematics)

Last fiddled with by science_man_88 on 2011-02-12 at 01:16
science_man_88 is offline   Reply With Quote
Old 2011-02-12, 14:20   #2181
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
Can you prove that it behaves the way you expect mod 7? Mod 3? Mod 4?
Code:
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,::3
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,::4
3,0,3,1,1,3,1,1,1,3,3,1,3,1,1,1,1,1,3,1,3,3,3,3,3,1,1,3,1,1,1,3,3,1,3,3,3,3,1,::7
3,7,31,43,43,31,43,43,43,31,31,43,31,43,43,43,43,43,31,43,31,31,31,31,31,43,43,31,43,43,43,31,31,43,31,31,31,31,43,::84
84 is a multiple of 3,4 and 7 so it's a matter of proving 31 and 43 align with the modulo 3,4 and 7 need according to this. 31%3 == 1 that aligns 43%3== 1 that also aligns, 31%4==3 that aligns and 43%4==3 so that also aligns, 31%7 =3 that aligns, 43%7 = 1 this also can align with the modulo so it is in fact plausible that this is true. Plausible is not a proof I know that. The proof needs to be more rigorous, if it's true maybe we can eliminate more checks when combined with 24x+7. though we know what x are mersenne numbers(it doesn't look to help though).

Last fiddled with by science_man_88 on 2011-02-12 at 14:31
science_man_88 is offline   Reply With Quote
Old 2011-02-12, 18:18   #2182
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
minimumprime(x) = if((x-2)%2==1,print(6*((x-2)-floor((x-2)*.5))-1),print(6*floor((.5*(x-2)))+1))
just thought I'd put this up.
science_man_88 is offline   Reply With Quote
Old 2011-02-12, 22:15   #2183
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
minimumprime(x) = if((x-2)%2==1,print(6*((x-2)-floor((x-2)*.5))-1),print(6*floor((.5*(x-2)))+1))
just thought I'd put this up.
and one thing I just learned by playing alt + 1(numpad) gets you back to the start of text and yes I get it's the control character start of header. something tells me if i every make long scripts that act as one line in PARI I'll be able to use it.
science_man_88 is offline   Reply With Quote
Old 2011-02-13, 01:34   #2184
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
minimumprime(x) = if((x-2)%2==1,print(6*((x-2)-floor((x-2)*.5))-1),print(6*floor((.5*(x-2)))+1))
just thought I'd put this up.
Don't print, just return! That way you can actually use the value instead of merely looking at it.
CRGreathouse is offline   Reply With Quote
Old 2011-02-13, 01:40   #2185
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Don't print, just return! That way you can actually use the value instead of merely looking at it.
I changed it to returning it the hard part now is I was trying to make a script that could use that value to get the real answer because by x = 1000 it's off by about 5000:

Code:
v=vector(13,n,minimumprime(n));v[1]=2;v[2]=3;c=[];a=0;for(x=1,#v,for(y=1,x-1,if(v[x]%v[y]==0,a=a+1));if(!a>1,c=concat(c,[v[x]])))
is my best attempt so far, but anyways I'm kinda repeating the same task I know.

Last fiddled with by science_man_88 on 2011-02-13 at 01:45
science_man_88 is offline   Reply With Quote
Old 2011-02-13, 01:52   #2186
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

I don't know what the function is supposed to return, nor by what measure it's off by 5000.
CRGreathouse is offline   Reply With Quote
Old 2011-02-13, 02:00   #2187
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
I don't know what the function is supposed to return, nor by what measure it's off by 5000.
Code:
(21:44)>prime(1000)
%38 = 7919
(22:00)>minimumprime(1000)
%39 = 2995
science_man_88 is offline   Reply With Quote
Old 2011-02-13, 02:14   #2188
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
(21:44)>prime(1000)
%38 = 7919
(22:00)>minimumprime(1000)
%39 = 2995
Are you trying to have it return the n-th prime? Why not use prime() in that case?
CRGreathouse is offline   Reply With Quote
Old 2011-02-13, 11:35   #2189
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
Are you trying to have it return the n-th prime? Why not use prime() in that case?
because I want to try and make one that works without that so it's not limited by primelimit.
science_man_88 is offline   Reply With Quote
Reply

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

All times are UTC. The time now is 15:31.


Fri Aug 6 15:31:32 UTC 2021 up 14 days, 10 hrs, 1 user, load averages: 2.31, 2.72, 2.83

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.