mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-08-11, 13:52   #221
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

You used 2701, which was a bad case. Here are some other bad bases and their ratios:

Code:
A141768=[9, 25, 49, 91, 341, 481, 703, 1541, 1891, 2701, 5461, 6533, 8911, 12403, 18721, 29341, 31621, 38503, 79003, 88831, 146611, 188191, 218791, 269011, 286903, 385003, 497503, 597871, 736291, 765703, 954271, 1024651, 1056331, 1152271, 1314631];
for(i=1,#A141768,print(ratio(A141768[i])"\t"A141768[i]))
gives something like
Code:
0.750000000     9
0.833333333     25
0.875000000     49
0.800000000     91
0.852941176     341
0.887500000     481
0.769230769     703
0.842857143     1541
0.761904762     1891
0.820000000     2701
0.838461538     5461
0.838028169     6533
0.800000000     8911
0.754716981     12403
0.835576923     18721
0.861963190     29341
0.835483871     31621
0.752688172     38503
0.751879699     79003
0.751773049     88831
0.751381215     146611
0.751219512     188191
0.751131221     218791
0.751020408     269011
0.750988142     286903
0.750853242     385003
0.750750750     497503
0.750684931     597871
0.750617283     736291
0.750605326     765703
0.750542299     954271
0.765217391     1024651
0.750515464     1056331
0.758884636     1152271
0.750462107     1314631
For more, see the b-file.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 13:53   #222
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Ah, thanks. Although, I do have it perform trial division for isSPRP, up to 106. isPRP does not perform trial division.
I'm not sure what trial division gets you here.

Quote:
Originally Posted by 3.14159 View Post
Also: Define star(n) (I haven't defined it already.)
I edited it in before you posted this. Sorry, I had it in the sequence but initially forgot to include it here.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 13:58   #223
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
Originally Posted by CRGreathouse
I edited it in before you posted this. Sorry, I had it in the sequence but initially forgot to include it here.
I looked in the sequence and found it. Now, the code works just fine.

I made a base counter as well:

Code:
bcount(n) = {
n = n * (1-(ratio(n)))
}
Corrections: 1-(ratio(n)) needs another set of parentheses. Corrections made.

Last fiddled with by 3.14159 on 2010-08-11 at 14:02
3.14159 is offline   Reply With Quote
Old 2010-08-11, 14:01   #224
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
I made a base counter as well:
That's already in the sequence! I just modified it to give the ratio, since that's what you cared about. Use *that* program, not the one you posted, since rounding errors will be important here.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 14:02   #225
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

32208 Posts
Default

Testing for primes: Expected result, every base registers prime.

Quote:
Originally Posted by CRGreathouse
That's already in the sequence! I just modified it to give the ratio, since that's what you cared about. Use *that* program, not the one you posted, since rounding errors will be important here.
Nope, it just gives how often it will be marked off as composite.

The base counter naturally followed. Rounding errors? Why did you make a program that was inaccurate? !

Last fiddled with by 3.14159 on 2010-08-11 at 14:04
3.14159 is offline   Reply With Quote
Old 2010-08-11, 14:09   #226
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
The base counter naturally followed. Rounding errors? Why did you make a program that was inaccurate? !
I made it output the result in floating-point because you gave the result as 0.82 rather than 41/50. It would be easy to modify the program to give an exact rational -- but why compute the sum, convert to a ratio, then convert back?


I don't understand what you mean by
Quote:
Originally Posted by 3.14159 View Post
Nope, it just gives how often it will be marked off as composite.
or if I'm supposed to respond to it.

Last fiddled with by CRGreathouse on 2010-08-11 at 14:10
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 14:09   #227
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
Why did you make a program that was inaccurate? !
I'm sure people could ask you that same question

Last fiddled with by science_man_88 on 2010-08-11 at 14:09
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 14:11   #228
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by CRGreathouse
I made it output the result in floating-point because you gave the result as 0.82 rather than 41/50. It would be easy to modify the program to give an exact rational -- but why compute the sum, convert to a ratio, then convert back?
Seeing as it works just fine for small numbers (I would rarely need it for large integers), it works for me!

Quote:
Originally Posted by CRGreathouse
I don't understand what you mean by...or if I'm supposed to respond to it.
Nevermind that..

Quote:
Originally Posted by science_man_88
I'm sure people could ask you that same question
And this statement, coming from one who can't properly define his own terminology, 97% of the time? Right, and the moon is made of cheese.

Last fiddled with by 3.14159 on 2010-08-11 at 14:27
3.14159 is offline   Reply With Quote
Old 2010-08-11, 14:12   #229
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I'm sure people could ask you that same question
True enough. My program gave the floating-point number closest to the exact quantity, but Pi's program suffers from catastrophic cancellation that may give wildly inaccurate results for large enough numbers and small enough precision. (They don't have to be that large or that low, even!)
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 14:14   #230
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Prime powers always have n-1 bases hat register it as pseudoprime.
You can see that just from examining the program: it looks only at the radical of the number.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 14:20   #231
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

so the basic idea I have of the process required is:

1)read for updates
2)send request to next part of script
3)find function names that can be understood in the text (if none exist give error and/or print questions the script has about the request)
4)print out code for functions if they are found to be in the database.
5) post code to Mersenne forums website.

Last fiddled with by science_man_88 on 2010-08-11 at 14:24
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 23:31.


Fri Aug 6 23:31:17 UTC 2021 up 14 days, 18 hrs, 1 user, load averages: 3.34, 3.74, 3.90

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.