mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2006-11-01, 01:30   #1
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

5×701 Posts
Default JasonG's gratuitous C++ thread

This is my C++ thread, for making comments and getting help when I begin my classes in January. Anybody knowing or doing anything involved in C or C++, especially if you're taking a class on it, feel free to post.

-----------------------------------------

In January, I plan to take a beginner's C++ class over at the University of Central Arkansas(UCA), here in Conway. I have no idea how far they go in one Semester, but I'm definitely looking forward to it.

I have this dream of taking 3 classes a semester(while keeping my part-time job) for a year or two, and having them all be computer science or math-related.

My ultimate(reasonable) goal in this class is to make a program that helps me search for what I call mirror primes. Basically, a mirror number(my made up cocept) is a number that, if flipped over, or flipped to the right or left(like turning a sheet of paper over), results in exactly the same number. For instance 11, 101, 818, and 1881 are all mirror numbers. I hope to make a program that generates these numbers, and then sieves them before running them through Alpertron's app.

2 questions:

1) The Primo website has some very strong language when it comes to running the program(Primo) in certain places. Is this simply to prevent legal liability or am I actually doing something punishable if I run his program(I live in the US). I understand that I won't get tech support from him, but, hopefully, the program would be easy to figure out.

2) Can someone supply me with a simple algebraic formula that could figure out how far to sieve for best efficiency? I assume that there are other things that need to be asked before the formula can be supplied, but I thought I should go ahead and throw it out there.
jasong is offline   Reply With Quote
Old 2006-11-01, 03:19   #2
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

170278 Posts
Default

This book sure helped me:

http://www.acceleratedcpp.com/
Xyzzy is offline   Reply With Quote
Old 2006-11-01, 05:49   #3
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

11×313 Posts
Default

Quote:
Originally Posted by jasong View Post
This is my C++ thread, for making comments and getting help when I begin my classes in January. Anybody knowing or doing anything involved in C or C++, especially if you're taking a class on it, feel free to post.

-----------------------------------------

In January, I plan to take a beginner's C++ class over at the University of Central Arkansas(UCA), here in Conway. I have no idea how far they go in one Semester, but I'm definitely looking forward to it.

I have this dream of taking 3 classes a semester(while keeping my part-time job) for a year or two, and having them all be computer science or math-related.

My ultimate(reasonable) goal in this class is to make a program that helps me search for what I call mirror primes. Basically, a mirror number(my made up cocept) is a number that, if flipped over, or flipped to the right or left(like turning a sheet of paper over), results in exactly the same number. For instance 11, 101, 818, and 1881 are all mirror numbers. I hope to make a program that generates these numbers, and then sieves them before running them through Alpertron's app.

2 questions:

1) The Primo website has some very strong language when it comes to running the program(Primo) in certain places. Is this simply to prevent legal liability or am I actually doing something punishable if I run his program(I live in the US). I understand that I won't get tech support from him, but, hopefully, the program would be easy to figure out.

2) Can someone supply me with a simple algebraic formula that could figure out how far to sieve for best efficiency? I assume that there are other things that need to be asked before the formula can be supplied, but I thought I should go ahead and throw it out there.
Good luck with college courses and job.

You might be interested in the page about palindomic primes.. Note the recent find at 170,007 digits by Harvey Dubner.

Would you download a copy of M$ Enterprise whatever from a peer-2-peer file sharing system, illegally? Just because there is no money to pay, it does not mean there is no licence agreement between the authors and the enduser -- you can make donations to Primo, but, because you reside in the USA, you *must not use* it, which is made plain at the Primo web site.

Sieving, depends on the formula you are using. If you were sieving over 1,2,3,4,...,N then there would be no need to PRP/LLR. Basically, you sieve until it becomes more time-efficeint to do PRP/LLR. That is the average time to next divisor found by the sieve is greater than the average LLR execution time of what is left after sieving. So you need to know the *average* PRP/LLR time of what is left and sieve until finding a divisor takes longer than that average. Divisors are roughly uniformly distributed over your dataset, so you can take the average at any time during sieving e.g. before you start the sieve. Work out your average LLR execution time. This will be dependent on what formula you are using. For fixed k as in k*2^n-1 it is a little tricky to work out the average; For large fix n (in the same form) it is easy -- the average is the time of any single test

(This thread is not about Mersenne Software )

Last fiddled with by paulunderwood on 2006-11-01 at 06:01
paulunderwood is offline   Reply With Quote
Old 2006-11-01, 10:59   #4
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

DB116 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
(This thread is not about Mersenne Software )
Sorry about that, I assumed it was a general forum. I guess I should've reviewed the posts already there.

Edit: looks like tetradic is the proper term for my "mirror primes"

Last fiddled with by jasong on 2006-11-01 at 11:03
jasong is offline   Reply With Quote
Old 2006-11-01, 13:43   #5
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3·1,163 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
you can make donations to Primo, but, because you reside in the USA, you *must not use* it, which is made plain at the Primo web site.
This license has always bothered me. Hypothetical question: if I coded up a primality proving program, and released it with license conditions stating that everyone but the author of Primo is allowed to use it, do you think it would become wildly popular in the USA, Canada and Japan? Humor me and assume such a program would not suck, but wouldn't be as good as Primo.

jasonp
jasonp is offline   Reply With Quote
Old 2006-11-01, 18:56   #6
Phil MjX
 
Phil MjX's Avatar
 
Sep 2004

5×37 Posts
Default

Quote:
Originally Posted by jasonp View Post
This license has always bothered me. Hypothetical question: if I coded up a primality proving program, and released it with license conditions stating that everyone but the author of Primo is allowed to use it, do you think it would become wildly popular in the USA, Canada and Japan? Humor me and assume such a program would not suck, but wouldn't be as good as Primo.

jasonp
I quote primo page :

" If the Author is advised that the Software is infringing a patent, the Author shall forbid distribution and use of the Software in all countries where the patent is applicable. "

Primo was (is still ?) used by companies to verify RSA prime candidates (and generate RSA keys)...Former versions of the program were sharewares with no ability to generate a certificate for candidates in an "industrial" RSA range...This limitation has been supressed but then I suppose the author has been informed the program was infringing some US softwares patents and he certainly don't want to change his freeware code in a less efficient way (or/and can't bear the idea of software patents ?)...

I am sure that if a freeware factorization program becomes popular and widely used for a reason or another, authors will recieve mails showing US patents violations and requesting money for licences...

Regards...

Philippe.

Last fiddled with by Phil MjX on 2006-11-01 at 19:00
Phil MjX is offline   Reply With Quote
Old 2006-11-01, 19:32   #7
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3·1,163 Posts
Default

Quote:
Originally Posted by Phil MjX View Post
but then I suppose the author has been informed the program was infringing some US softwares patents and he certainly don't want to change his freeware code in a less efficient way (or/and can't bear the idea of software patents ?)...
That's true, I just assumed the author chose the license conditions as a social/political statement, and not in response to actual legal threats.
Quote:
Originally Posted by Phil MjX View Post
I am sure that if a freeware factorization program becomes popular and widely used for a reason or another, authors will recieve mails showing US patents violations and requesting money for licences...
I've wondered about this, since I happen to be in the factorization program business :) Although there's reason for hope since nobody has tried to extort money from the GGNFS developers.

jasonp
jasonp is offline   Reply With Quote
Old 2006-11-01, 22:46   #8
Phil MjX
 
Phil MjX's Avatar
 
Sep 2004

5·37 Posts
Default

Quote:
Originally Posted by jasonp View Post
I've wondered about this, since I happen to be in the factorization program business :) Although there's reason for hope since nobody has tried to extort money from the GGNFS developers.

jasonp
When msieve will be able to break RSA512 keys in a few hours, you sure will be concerned
Phil MjX is offline   Reply With Quote
Old 2006-11-02, 07:08   #9
S485122
 
S485122's Avatar
 
Sep 2006
Brussels, Belgium

23×197 Posts
Default

Quote:
Originally Posted by jasonp View Post
That's true, I just assumed the author chose the license conditions as a social/political statement, and not in response to actual legal threats.
I think the patent laws of the USA, Canada, Japan and now EU are completely flawed. One can patent the concept of hyperlinks (US4873622), the action of identifying oneself to do a purchase (EP 0 902 381 A2), the concept of stylesheets (US5860073)...

The author of primo objects to those laws as they constitute a danger for any software development.

More on this on
http://swpat.ffii.org/vreji/pikta/index.en.html
www.freepatents.org (not online at this moment)
...
S485122 is offline   Reply With Quote
Old 2006-11-02, 17:47   #10
fetofs
 
fetofs's Avatar
 
Aug 2005
Brazil

1011010102 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
(This thread is not about Mersenne Software )
This thread shouldn't be about C++?
fetofs is offline   Reply With Quote
Old 2006-11-02, 18:01   #11
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

DA116 Posts
Default

Quote:
Originally Posted by Jacob Visser View Post
I think the patent laws of the USA, Canada, Japan and now EU are completely flawed. One can patent the concept of hyperlinks (US4873622), the action of identifying oneself to do a purchase (EP 0 902 381 A2), the concept of stylesheets (US5860073)...
Of course I agree, these things are silly.
Quote:
Originally Posted by Jacob Visser View Post
The author of primo objects to those laws as they constitute a danger for any software development.
I respect his objection. And it's his software, so he can choose to license it any way he wants. I'm just saying that unless he is responding to a specific legal threat, pre-emptively draconian license terms get me angry. What if the license had read 'You may not use this software in the US, Canada and Japan, because these countries are bad'? Um, I'm not going to change the law by myself, and I'm not going to move somewhere else just to use primo, so the license amounts to punishing me because I'm American. Forgive me if that pisses me off.

jasonp
jasonp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gratuitous factors thread fivemack Factoring 501 2020-10-20 17:31
Jasong's make something of your life through education thread jasong jasong 20 2018-01-05 16:43
JasonG's rant thread jasong Soap Box 36 2007-09-18 13:43
spending thread for JasonG(for a cruncher) jasong Hardware 10 2007-04-14 22:14
Gratuitous hardware-related banana thread GP2 Hardware 7 2003-11-24 06:13

All times are UTC. The time now is 23:11.

Thu Oct 22 23:11:01 UTC 2020 up 42 days, 20:21, 1 user, load averages: 1.56, 1.66, 1.73

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.