https://wiki.haskell.org/api.php?action=feedcontributions&user=Marypoppins&feedformat=atomHaskellWiki - User contributions [en]2022-08-15T16:09:22ZUser contributionsMediaWiki 1.31.7https://wiki.haskell.org/index.php?title=Talk:Euler_problems&diff=20740Talk:Euler problems2008-04-29T22:40:47Z<p>Marypoppins: </p>
<hr />
<div>As one of the teammembers of Project Euler I must say that you are doing Project Euler not a great favour by maintaining this site.<br />
How is it possible that you are so blinded by your enthousiasm of a particular programming environment that you lose out of sight the true nature of Project Euler: problem solving, disregarding all differences of programming languages.<br />
As all problems are there, even the most recent ones, those responsible for this must be found among our 100%-ers.<br />
Please realise how much work of us you are spoiling with this work and stop spoling our work. Better still: remove it altogether from public domain.<br />
Threatening to consider any amendment as vandalism is really a gotspe.<br />
It's you that are vandalising our work.<br />
<br />
Hans Klein (aka hk) <br />
<br />
----<br />
quote:<br />
''Additionally, for convenience in checking solutions, a list of pairs giving the exact Euler answers is available''<br />
<br />
Cale, why are you doing these things just to annoy us? Don't you have better things to do than trying to kill project euler?<br />
--<br />
<br />
In addition I don't see the use of this checklist.<br />
Anyone that wants to check the correctness of his answer can do so at the Project Euler site.<br />
It seems more a deliberate attempt to kill Project Euler.<br />
Perhaps Gale should do some introspection about his true motives.<br />
<br />
[[User hk|hk]]<br />
----<br />
<br />
quote:<br />
''On the other hand, this problem space is perfect for illustrating the power of Haskell, and for providing excellent examples of how to "think in Haskell".'' <br />
<br />
The solutions to some of the harder problems are in C++, so that has nothing to do with the power of Haskell. Please remove the solutions from this page. If you want to show your Haskell solution please do so in the forum of a problem.<br />
<br />
Stijn aka henk263<br />
<br />
-----<br />
<br />
If you openly publish problems, people will be free to openly publish solutions to them. There's not a whole lot which can be done about it. This is the same issue as a game developer saying "please don't publish a walkthrough to our game". You can ask, but it's pretty much guaranteed that someone will inevitably do it.<br />
<br />
Moreover, it doesn't harm anyone's enjoyment of the game. The pages are clearly marked as containing spoilers, and those who don't want to see the spoilers can avoid them quite easily.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 18:58, 23 February 2008 (UTC)<br />
<br />
The solutions in C++ would indeed be better off replaced by Haskell code. This is, after all the Haskell wiki. However, removing the solutions altogether would be silly. (Not to mention ineffective, as they would remain in the page history.)<br />
<br />
If you want to have a contest with problems to which nobody can look up the solution, construct a list of problems which nobody has seen before and hold the contest all at once. Long term contests in which the problems have trivial (i.e. known) solutions won't hold up.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 19:08, 23 February 2008 (UTC)<br />
<br />
I think you misunderstand Project Euler.<br />
To my opninion it's not a contest. But by publishing worked out solutions you are spoiling the fun for those that love to solve problems.<br />
Of course not much can be done to such "look me being smart" people that haven't even to guts to design their own problems to write their programming tutorial. Moreover stealing other peoples solutions (problem 181) does not look very smart either.<br />
<br />
[[User: hk|hk]] <br />
<br />
Those who love to solve problems should have no problem with this site. They just won't read it. The only possible way one could have a complaint about published solutions to the problems is if one thought of the site as a contest by which people are being judged and compared. If the problems are meant only for personal use, there's no issue, since the only person one might cheat by looking at the solution is oneself.<br />
<br />
If one had already given up on finding the solution, being able to look at a solution is potentially educational as well.<br />
<br />
I should perhaps point out that I've not personally had any hand in constructing any of these solutions (though I did clean up the formatting on some of them not long ago), and haven't spent much time working on Project Euler myself either (the problems are not of a sort which I find interesting, there are not nearly enough universal quantifiers in them). I do, however, think that people who put useful things on this wiki should not have them arbitrarily damaged.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 20:07, 23 February 2008 (UTC)<br />
<br />
Quite a few of the recent C++ additions are just stolen from the problem's forum. I'm pretty sure that neither '''balakrishnan''' nor '''Daniel.is.fischer''' put anything here. <br />
<br />
[[User: henk263|henk263]] <br />
<br />
Cale<br />
All your arguments fail if you see that the one that put those Haskell (and C++)<br />
solutions here has even gone so far as to put the direct answers to the problems on this page http://www.haskell.org/haskellwiki/Euler_answers.<br />
This goes too far.<br />
I urgently request that that page and this one should be removed from this Haskell wiki. This has nothing to do with Haskell anymore.<br />
<br />
[[User: hk|hk]]<br />
<br />
I still don't see why you should care about the solutions being published. If particular solutions can be shown to violate people's copyright, then those should be removed. Everything on this wiki is meant to be published under the [[HaskellWiki:Copyrights|simple permissive license]]. Otherwise, I see no reason to remove anything.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 21:52, 23 February 2008 (UTC)<br />
<br />
For me, it spoils the fun of 'climbing up the ladder'. I don't get why this list of numbers belongs in an HASKELLwiki :S<br />
<br />
[[User: henk263|henk263]] <br />
<br />
If it would spoil the fun, don't look at it. What's your problem? If your value system is so messed up that you get more satisfaction out of seeing your progress bar go up faster than other people's progress bars than from actually solving the problems yourself, then I think you probably have some serious self-evaluation to do. Also, until then, I have a [http://www.progressquest.com/ video game] in which you might be interested<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 22:04, 23 February 2008 (UTC)<br />
<br />
I guess I do see project euler partly as a contest. There's no need to get personal. I'm very sure that I'm not the only one who doesn't like the idea that all solutions are available to everyone.<br />
<br />
Also aren't almost all online games based on seeing your own progress bar go up faster than other people's? Not that PE is a game, but still, I don't think I need to do any self-evaluation :S<br />
<br />
[[User: henk263|henk263]]<br />
<br />
You definitely have some introspection to do regarding your motives for doing things.<br />
<br />
The pages won't be removed, and none of the solutions will be removed unless you can prove some legal reason that they must be. Obviously some people find them useful, they are largely Haskell content, or of use to people solving the problems in Haskell, and so are on topic. Leave it alone.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 22:28, 23 February 2008 (UTC)<br />
<br />
The Project Euler problems are copyrighted under the creative commons license.<br />
http://projecteuler.net/index.php?section=copyright<br />
http://creativecommons.org/licenses/by-nc-sa/2.0/uk/<br />
Legal version http://creativecommons.org/licenses/by-nc-sa/2.0/uk/legalcode<br />
If you read this you will see that the [[HaskellWiki:Copyrights|simple permissive license]] is not identical to the creative commons licence.<br />
The share alike condition reads:<br />
"Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a licence identical to this one."<br />
So in fact the pages I referred to are both infringing in the Project Euler copyright.<br />
<br />
[[User: hk|hk]]<br />
<br />
:None of these pages contain any of the problem statements or content published on the Project Euler site. --[[User:CaleGibbard|CaleGibbard]] 22:31, 23 February 2008 (UTC)<br />
<br />
::You overlook the phrase "or build upon this work," and you cannot deny that those pages build on the Project Euler work.<br />
::Moreover, some solutions are copies from the Project Euler Forum. --[[User: hk|hk]]<br />
<br />
:::It refers to making derivative works; these are no more derivative works than my saying 'What is 2+2?' a derivative work of the work of kindergartener teachers. These are eternal mathematical theorems and principles; they can no more be copyrighted or trademarked or patented than can a prime number, even if it takes decades to compute it.<br />
:::I certainly do agree with you about the problematic copyright status of the solutions, though. --[[User:Gwern|Gwern]] 00:15, 24 February 2008 (UTC)<br />
<br />
-----<br />
These pages must be deleted.<br />
<br />
They are not in the spirit of Project Euler.<br />
<br />
They are ruining the fun of problems and the fun of climbing up the ladder.<br />
<br />
I am aware that whoever posted this is probably smart and would like us all to know.<br />
<br />
Meanwhile:<br />
<br />
RULE #1 of Project Euler:<br />
<br />
You do not discuss Project Euler solutions.<br />
<br />
RULE #2 of Project Euler:<br />
<br />
You do not discuss Project Euler solutions.<br />
<br />
Keep it in the problem threads.<br />
<br />
----<br />
<br />
I disagree. These are clearly marked as "spoilers". Anyone<br />
who wants to participate in Project Euler and enjoy its<br />
benefits knows that they should not peek at these solutions.<br />
<br />
On the other hand, this problem space is perfect for<br />
illustrating the power of Haskell, and for providing<br />
excellent examples of how to "think in Haskell".<br />
I would refer anyone thinking of learning Haskell to<br />
these pages - with the warning that they might<br />
first want to solve all of the problems in their<br />
current favorite programming language.<br />
<br />
My guess is that many people would look at the<br />
first few solutions, become hooked, and then<br />
redo the rest of them on their own in Haskell<br />
without peeking!<br />
<br />
----<br />
You kill the fun! <br />
<br />
There is only way to publish solution - just protect access to it <br />
with right solution answer, as Euler protects access <br />
to forum's threads.<br />
<br />
But in wiki - these pages must be deleted.<br />
<br />
----<br />
<br />
Note that if you delete these pages, it will be treated as vandalism and reverted. [[User:CaleGibbard|CaleGibbard]] 19:56, 21 February 2008 (UTC)<br />
<br />
----<br />
Category tags are great for making the Haskell wiki easier<br />
to navigate. But having category tags on all of the detail<br />
pages of these problem sets has the opposite effect - it<br />
just clutters the category pages.<br />
<br />
I am removing the category tags from all of the detail pages,<br />
and leaving them only on the main page.<br />
<br />
----<br />
<br />
Either restrict the access to these pages to those who have the solution or delete them, please. It's just not cricket to violate the Project Euler spirit. [[User:Daniel.is.fischer|Daniel.is.fischer]]<br />
<br />
----<br />
<br />
Not everypone plays cricket! [[User:SamB|SamB]] 23:11, 23 February 2008 (UTC)<br />
<br />
== C++ copyvios ==<br />
<br />
I've removed all the C/C++ code I saw on the problem pages. I have no problems with including answers (be they programmatic or constants), but the C code is very problematic. I can assume good faith and believe that all of the text and Haskell code is Freely and correctly licensed (a few answers to the contrary...), but I find it much harder to believe that a Haskeller would license his own C++ code Freely but not also provide a Haskell solution, and harder still when I see assertions that the code is stolen all from Project Euler's internal fora. <br />
<br />
So, I've removed them. I hope I will not see the code re-added; until it's shown that they are licensed appropriately for the wiki, I intend to make sure they are kept off. Cale, as for page history - yes, deletion and partial recreation would be ideal, however I am not an administrator here and so cannot do it. If my wikideletions are ever asserted by one of the copyright holders to be insufficient, well, then we can go back and delete with fire. --[[User:Gwern|Gwern]] 00:15, 24 February 2008 (UTC)<br />
<br />
:I identified several remaining C codes.<br />
:I checked them in the problem Euler forum to be from several different PE users.<br />
:I now put a note in place of this C code stating who published them on the PE Forum.<br />
:It seems that the statement "None of these pages contain any of the problem statements or content published on the Project Euler site. " was somewhat preposterous. --[[User hk|hk]]<br />
<br />
:::I missed some, huh... OK, good. Hopefully that's the last of the copyvios. --[[User:Gwern|Gwern]] 16:01, 24 February 2008 (UTC)<br />
<br />
== Protected ==<br />
<br />
I have protected this page, and will protect other pages as necessary. There seem to be two issues here:<br />
<br />
* '''Copyright violations:''' anything that is not available under our [[HaskellWiki:Copyrights|simple permissive license]] must be removed immediately. Thank you, Gwern, for doing this.<br />
<br />
* '''Spoiling Project Euler:''' HaskellWiki is not part of Project Euler and is therefore not bound by its rules or guided by its values or spirit. HaskellWiki's purpose is, roughly, to promote Haskell. If publishing the Euler problems and their solutions in Haskell serves that purpose then that belongs on this wiki. Some people might be annoyed by being unexpectedly given these solutions: for that reason we should warn them with the appropriate spoiler notices.<br />
<br />
&mdash;[[User:Ashley Y|Ashley Y]] 23:18, 24 February 2008 (UTC)<br />
<br />
:Unprotected now. &mdash;[[User:Ashley Y|Ashley Y]] 22:27, 12 March 2008 (UTC)<br />
<br />
----<br />
<br />
Another vote for its being utterly childish to post solutions to puzzles on another site in contradiction to the wishes of its admins.<br />
<br />
Mark<br />
<br />
----<br />
Quote: ''HaskellWiki is not part of Project Euler and is therefore not bound by its rules or guided by its values or spirit. HaskellWiki's purpose is, roughly, to promote Haskell. If publishing the Euler problems and their solutions in Haskell serves that purpose then that belongs on this wiki. Some people might be annoyed by being unexpectedly given these solutions: for that reason we should warn them with the appropriate spoiler notices''<br />
<br />
And does this sound like democracy to you? It sounds like nazi to me. Like "we do what we want, if that bothers you well, it's not our problem."<br />
<br />
:Actually, it sounds like Libertarianism to me. But if you want to draw specious comparisons and Godwin yourself, go ahead.<br />
<br />
There are billions of problems in internet, which are already published with a solution. Many puzzle sites publish a problem and after one week they provide the solution too. Why can't you just pick one of them? There are plenty of problems that could be useful to learn haskell.<br />
<br />
:If those billions of problems are so useful and suitable, then why aren't Haskellers doing them instead? --[[User:Gwern|Gwern]] 20:55, 29 April 2008 (UTC)<br />
<br />
Also, once I have learned how to use (eg.) an array, why should I learn it again? I don't see new haskell concept published in every solution you provide, so, if this was just to improve haskell skills, why you spoil problems that touch things already covered?<br />
<br />
When you play at project euler, you begin a journey. Some people don't care about the ranking, some others do. For those, knowing that solutions are available for everybody, its not pleasant, because then the ranking is not the same any more. You are always left with the doubt that who's ranked higher than you might have cheated. Personally, every time a new problem comes out, my only preoccupation is to solve it and post my solution on p.e. forum BEFORE some of you post the solution here, so if someone goes and check me I don't mind because I'm clean.<br />
<br />
Concluding, you certainly do have the rights to do what the law lets you do, but you should understand that your rights fall down when you do something that bothers other people (a lot, believe me). Even more when you could easily choose another site of the kind I said before, one of those which provide solutions to their problems.<br />
<br />
Haskell learners would still learn, and p.e. users would be able to play in peace. If you don't understand this then you should try.<br />
<br />
sfabriz<br />
<br />
----<br />
Actually, it sounds like Libertarianism to me. But if you want to draw specious comparisons and Godwin yourself, go ahead.<br />
<br />
: Actually I didn't know about this Godwin's law so thank you, I learned something new. Anyway, leaving every nazi stuff apart, the question is really why to spoil p.e. problems. If you look at words like "math puzzle, problems, programming challenges, etc." on google, you can find plenty of really cool websites that provide similar content than what you find on p.e.: math stuff, programming stuff, geometry stuff, and so on.<br />
:So, since some of them don't keep score like it's done on p.e., why not to choose one of them? I mean, if you want to show say a Fibonacci generator, isn't it good to apply your code to a Fibonacci related problem? At that point, isn't any Fibonacci related problem good? So I guess it would be possible to choose a Fibonacci related problem from some site that also gives the solution. In this way you would have achieved what you claim (promote haskell) and nobody would be hurt, therefore everybody wins.<br />
:Wouldn't it be good for everybody?<br />
<br />
If those billions of problems are so useful and suitable, then why aren't Haskellers doing them instead?<br />
<br />
:Let me get this right. Do you really think p.e. is the only source for interesting maths problems? With all respect, but I don't think so. Ever heard of uva (http://acm.uva.es/problemset/)? And this is just an example. You just have to open google and search.<br />
<br />
sfabriz</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Talk:Euler_problems&diff=20731Talk:Euler problems2008-04-29T10:19:15Z<p>Marypoppins: </p>
<hr />
<div>As one of the teammembers of Project Euler I must say that you are doing Project Euler not a great favour by maintaining this site.<br />
How is it possible that you are so blinded by your enthousiasm of a particular programming environment that you lose out of sight the true nature of Project Euler: problem solving, disregarding all differences of programming languages.<br />
As all problems are there, even the most recent ones, those responsible for this must be found among our 100%-ers.<br />
Please realise how much work of us you are spoiling with this work and stop spoling our work. Better still: remove it altogether from public domain.<br />
Threatening to consider any amendment as vandalism is really a gotspe.<br />
It's you that are vandalising our work.<br />
<br />
Hans Klein (aka hk) <br />
<br />
----<br />
quote:<br />
''Additionally, for convenience in checking solutions, a list of pairs giving the exact Euler answers is available''<br />
<br />
Cale, why are you doing these things just to annoy us? Don't you have better things to do than trying to kill project euler?<br />
--<br />
<br />
In addition I don't see the use of this checklist.<br />
Anyone that wants to check the correctness of his answer can do so at the Project Euler site.<br />
It seems more a deliberate attempt to kill Project Euler.<br />
Perhaps Gale should do some introspection about his true motives.<br />
<br />
[[User hk|hk]]<br />
----<br />
<br />
quote:<br />
''On the other hand, this problem space is perfect for illustrating the power of Haskell, and for providing excellent examples of how to "think in Haskell".'' <br />
<br />
The solutions to some of the harder problems are in C++, so that has nothing to do with the power of Haskell. Please remove the solutions from this page. If you want to show your Haskell solution please do so in the forum of a problem.<br />
<br />
Stijn aka henk263<br />
<br />
-----<br />
<br />
If you openly publish problems, people will be free to openly publish solutions to them. There's not a whole lot which can be done about it. This is the same issue as a game developer saying "please don't publish a walkthrough to our game". You can ask, but it's pretty much guaranteed that someone will inevitably do it.<br />
<br />
Moreover, it doesn't harm anyone's enjoyment of the game. The pages are clearly marked as containing spoilers, and those who don't want to see the spoilers can avoid them quite easily.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 18:58, 23 February 2008 (UTC)<br />
<br />
The solutions in C++ would indeed be better off replaced by Haskell code. This is, after all the Haskell wiki. However, removing the solutions altogether would be silly. (Not to mention ineffective, as they would remain in the page history.)<br />
<br />
If you want to have a contest with problems to which nobody can look up the solution, construct a list of problems which nobody has seen before and hold the contest all at once. Long term contests in which the problems have trivial (i.e. known) solutions won't hold up.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 19:08, 23 February 2008 (UTC)<br />
<br />
I think you misunderstand Project Euler.<br />
To my opninion it's not a contest. But by publishing worked out solutions you are spoiling the fun for those that love to solve problems.<br />
Of course not much can be done to such "look me being smart" people that haven't even to guts to design their own problems to write their programming tutorial. Moreover stealing other peoples solutions (problem 181) does not look very smart either.<br />
<br />
[[User: hk|hk]] <br />
<br />
Those who love to solve problems should have no problem with this site. They just won't read it. The only possible way one could have a complaint about published solutions to the problems is if one thought of the site as a contest by which people are being judged and compared. If the problems are meant only for personal use, there's no issue, since the only person one might cheat by looking at the solution is oneself.<br />
<br />
If one had already given up on finding the solution, being able to look at a solution is potentially educational as well.<br />
<br />
I should perhaps point out that I've not personally had any hand in constructing any of these solutions (though I did clean up the formatting on some of them not long ago), and haven't spent much time working on Project Euler myself either (the problems are not of a sort which I find interesting, there are not nearly enough universal quantifiers in them). I do, however, think that people who put useful things on this wiki should not have them arbitrarily damaged.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 20:07, 23 February 2008 (UTC)<br />
<br />
Quite a few of the recent C++ additions are just stolen from the problem's forum. I'm pretty sure that neither '''balakrishnan''' nor '''Daniel.is.fischer''' put anything here. <br />
<br />
[[User: henk263|henk263]] <br />
<br />
Cale<br />
All your arguments fail if you see that the one that put those Haskell (and C++)<br />
solutions here has even gone so far as to put the direct answers to the problems on this page http://www.haskell.org/haskellwiki/Euler_answers.<br />
This goes too far.<br />
I urgently request that that page and this one should be removed from this Haskell wiki. This has nothing to do with Haskell anymore.<br />
<br />
[[User: hk|hk]]<br />
<br />
I still don't see why you should care about the solutions being published. If particular solutions can be shown to violate people's copyright, then those should be removed. Everything on this wiki is meant to be published under the [[HaskellWiki:Copyrights|simple permissive license]]. Otherwise, I see no reason to remove anything.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 21:52, 23 February 2008 (UTC)<br />
<br />
For me, it spoils the fun of 'climbing up the ladder'. I don't get why this list of numbers belongs in an HASKELLwiki :S<br />
<br />
[[User: henk263|henk263]] <br />
<br />
If it would spoil the fun, don't look at it. What's your problem? If your value system is so messed up that you get more satisfaction out of seeing your progress bar go up faster than other people's progress bars than from actually solving the problems yourself, then I think you probably have some serious self-evaluation to do. Also, until then, I have a [http://www.progressquest.com/ video game] in which you might be interested<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 22:04, 23 February 2008 (UTC)<br />
<br />
I guess I do see project euler partly as a contest. There's no need to get personal. I'm very sure that I'm not the only one who doesn't like the idea that all solutions are available to everyone.<br />
<br />
Also aren't almost all online games based on seeing your own progress bar go up faster than other people's? Not that PE is a game, but still, I don't think I need to do any self-evaluation :S<br />
<br />
[[User: henk263|henk263]]<br />
<br />
You definitely have some introspection to do regarding your motives for doing things.<br />
<br />
The pages won't be removed, and none of the solutions will be removed unless you can prove some legal reason that they must be. Obviously some people find them useful, they are largely Haskell content, or of use to people solving the problems in Haskell, and so are on topic. Leave it alone.<br />
<br />
[[User:CaleGibbard|CaleGibbard]] 22:28, 23 February 2008 (UTC)<br />
<br />
The Project Euler problems are copyrighted under the creative commons license.<br />
http://projecteuler.net/index.php?section=copyright<br />
http://creativecommons.org/licenses/by-nc-sa/2.0/uk/<br />
Legal version http://creativecommons.org/licenses/by-nc-sa/2.0/uk/legalcode<br />
If you read this you will see that the [[HaskellWiki:Copyrights|simple permissive license]] is not identical to the creative commons licence.<br />
The share alike condition reads:<br />
"Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a licence identical to this one."<br />
So in fact the pages I referred to are both infringing in the Project Euler copyright.<br />
<br />
[[User: hk|hk]]<br />
<br />
:None of these pages contain any of the problem statements or content published on the Project Euler site. --[[User:CaleGibbard|CaleGibbard]] 22:31, 23 February 2008 (UTC)<br />
<br />
::You overlook the phrase "or build upon this work," and you cannot deny that those pages build on the Project Euler work.<br />
::Moreover, some solutions are copies from the Project Euler Forum. --[[User: hk|hk]]<br />
<br />
:::It refers to making derivative works; these are no more derivative works than my saying 'What is 2+2?' a derivative work of the work of kindergartener teachers. These are eternal mathematical theorems and principles; they can no more be copyrighted or trademarked or patented than can a prime number, even if it takes decades to compute it.<br />
:::I certainly do agree with you about the problematic copyright status of the solutions, though. --[[User:Gwern|Gwern]] 00:15, 24 February 2008 (UTC)<br />
<br />
-----<br />
These pages must be deleted.<br />
<br />
They are not in the spirit of Project Euler.<br />
<br />
They are ruining the fun of problems and the fun of climbing up the ladder.<br />
<br />
I am aware that whoever posted this is probably smart and would like us all to know.<br />
<br />
Meanwhile:<br />
<br />
RULE #1 of Project Euler:<br />
<br />
You do not discuss Project Euler solutions.<br />
<br />
RULE #2 of Project Euler:<br />
<br />
You do not discuss Project Euler solutions.<br />
<br />
Keep it in the problem threads.<br />
<br />
----<br />
<br />
I disagree. These are clearly marked as "spoilers". Anyone<br />
who wants to participate in Project Euler and enjoy its<br />
benefits knows that they should not peek at these solutions.<br />
<br />
On the other hand, this problem space is perfect for<br />
illustrating the power of Haskell, and for providing<br />
excellent examples of how to "think in Haskell".<br />
I would refer anyone thinking of learning Haskell to<br />
these pages - with the warning that they might<br />
first want to solve all of the problems in their<br />
current favorite programming language.<br />
<br />
My guess is that many people would look at the<br />
first few solutions, become hooked, and then<br />
redo the rest of them on their own in Haskell<br />
without peeking!<br />
<br />
----<br />
You kill the fun! <br />
<br />
There is only way to publish solution - just protect access to it <br />
with right solution answer, as Euler protects access <br />
to forum's threads.<br />
<br />
But in wiki - these pages must be deleted.<br />
<br />
----<br />
<br />
Note that if you delete these pages, it will be treated as vandalism and reverted. [[User:CaleGibbard|CaleGibbard]] 19:56, 21 February 2008 (UTC)<br />
<br />
----<br />
Category tags are great for making the Haskell wiki easier<br />
to navigate. But having category tags on all of the detail<br />
pages of these problem sets has the opposite effect - it<br />
just clutters the category pages.<br />
<br />
I am removing the category tags from all of the detail pages,<br />
and leaving them only on the main page.<br />
<br />
----<br />
<br />
Either restrict the access to these pages to those who have the solution or delete them, please. It's just not cricket to violate the Project Euler spirit. [[User:Daniel.is.fischer|Daniel.is.fischer]]<br />
<br />
----<br />
<br />
Not everypone plays cricket! [[User:SamB|SamB]] 23:11, 23 February 2008 (UTC)<br />
<br />
== C++ copyvios ==<br />
<br />
I've removed all the C/C++ code I saw on the problem pages. I have no problems with including answers (be they programmatic or constants), but the C code is very problematic. I can assume good faith and believe that all of the text and Haskell code is Freely and correctly licensed (a few answers to the contrary...), but I find it much harder to believe that a Haskeller would license his own C++ code Freely but not also provide a Haskell solution, and harder still when I see assertions that the code is stolen all from Project Euler's internal fora. <br />
<br />
So, I've removed them. I hope I will not see the code re-added; until it's shown that they are licensed appropriately for the wiki, I intend to make sure they are kept off. Cale, as for page history - yes, deletion and partial recreation would be ideal, however I am not an administrator here and so cannot do it. If my wikideletions are ever asserted by one of the copyright holders to be insufficient, well, then we can go back and delete with fire. --[[User:Gwern|Gwern]] 00:15, 24 February 2008 (UTC)<br />
<br />
:I identified several remaining C codes.<br />
:I checked them in the problem Euler forum to be from several different PE users.<br />
:I now put a note in place of this C code stating who published them on the PE Forum.<br />
:It seems that the statement "None of these pages contain any of the problem statements or content published on the Project Euler site. " was somewhat preposterous. --[[User hk|hk]]<br />
<br />
:::I missed some, huh... OK, good. Hopefully that's the last of the copyvios. --[[User:Gwern|Gwern]] 16:01, 24 February 2008 (UTC)<br />
<br />
== Protected ==<br />
<br />
I have protected this page, and will protect other pages as necessary. There seem to be two issues here:<br />
<br />
* '''Copyright violations:''' anything that is not available under our [[HaskellWiki:Copyrights|simple permissive license]] must be removed immediately. Thank you, Gwern, for doing this.<br />
<br />
* '''Spoiling Project Euler:''' HaskellWiki is not part of Project Euler and is therefore not bound by its rules or guided by its values or spirit. HaskellWiki's purpose is, roughly, to promote Haskell. If publishing the Euler problems and their solutions in Haskell serves that purpose then that belongs on this wiki. Some people might be annoyed by being unexpectedly given these solutions: for that reason we should warn them with the appropriate spoiler notices.<br />
<br />
&mdash;[[User:Ashley Y|Ashley Y]] 23:18, 24 February 2008 (UTC)<br />
<br />
:Unprotected now. &mdash;[[User:Ashley Y|Ashley Y]] 22:27, 12 March 2008 (UTC)<br />
<br />
----<br />
<br />
Another vote for its being utterly childish to post solutions to puzzles on another site in contradiction to the wishes of its admins.<br />
<br />
Mark<br />
<br />
----<br />
Quote: ''HaskellWiki is not part of Project Euler and is therefore not bound by its rules or guided by its values or spirit. HaskellWiki's purpose is, roughly, to promote Haskell. If publishing the Euler problems and their solutions in Haskell serves that purpose then that belongs on this wiki. Some people might be annoyed by being unexpectedly given these solutions: for that reason we should warn them with the appropriate spoiler notices''<br />
<br />
And does this sound like democracy to you? It sounds like nazi to me. Like "we do what we want, if that bothers you well, it's not our problem."<br />
<br />
There are billions of problems in internet, which are already published with a solution. Many puzzle sites publish a problem and after one week they provide the solution too. Why can't you just pick one of them? There are plenty of problems that could be useful to learn haskell.<br />
<br />
Also, once I have learned how to use (eg.) an array, why should I learn it again? I don't see new haskell concept published in every solution you provide, so, if this was just to improve haskell skills, why you spoil problems that touch things already covered?<br />
<br />
When you play at project euler, you begin a journey. Some people don't care about the ranking, some others do. For those, knowing that solutions are available for everybody, its not pleasant, because then the ranking is not the same any more. You are always left with the doubt that who's ranked higher than you might have cheated. Personally, every time a new problem comes out, my only preoccupation is to solve it and post my solution on p.e. forum BEFORE some of you post the solution here, so if someone goes and check me I don't mind because I'm clean.<br />
<br />
Concluding, you certainly do have the rights to do what the law lets you do, but you should understand that your rights fall down when you do something that bothers other people (a lot, believe me). Even more when you could easily choose another site of the kind I said before, one of those which provide solutions to their problems.<br />
<br />
Haskell learners would still learn, and p.e. users would be able to play in peace. If you don't understand this then you should try.<br />
<br />
sfabriz</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/61_to_70&diff=18787Euler problems/61 to 702008-01-29T21:53:10Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/61_to_70&diff=18786Euler problems/61 to 702008-01-29T21:52:42Z<p>Marypoppins: </p>
<hr />
<div>== [http://projecteuler.net/index.php?section=problems&id=61 Problem 61] ==<br />
Find the sum of the only set of six 4-digit figurate numbers with a cyclic property.<br />
<br />
Solution:<br />
<haskell><br />
import Data.List<br />
<br />
permute [] = [[]]<br />
permute xs = concatMap (\x -> map (x:) $ permute $ delete x xs) xs<br />
<br />
figurates n xs = extract $ concatMap (gather (map poly xs)) $ map (:[]) $ poly n<br />
where gather [xs] (v:vs) <br />
= let v' = match xs v<br />
in if v' == [] then [] else map (:v:vs) v'<br />
gather (xs:xss) (v:vs) <br />
= let v' = match xs v<br />
in if v' == [] then [] else concatMap (gather xss) $ map (:v:vs) v'<br />
match xs (_,v) = let p = (v `mod` 100)*100 in sublist (p+10,p+100) xs<br />
sublist (s,e) = takeWhile (\(_,x) -> x<e) . dropWhile (\(_,x) -> x<s)<br />
link ((_,x):xs) = x `mod` 100 == (snd $ last xs) `div` 100<br />
diff (x:y:xs) = if fst x /= fst y then diff (y:xs) else False<br />
diff [x] = True<br />
extract = filter diff . filter link<br />
poly m = [(n, x) | (n, x) <- zip [1..] $ takeWhile (<10000) <br />
$ scanl (+) 1 [m-1,2*m-3..], <br />
1010 < x, x `mod` 100 > 9]<br />
<br />
problem_61 = sum $ map snd $ head $ concatMap (figurates 3) $ permute [4..8]<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=62 Problem 62] ==<br />
Find the smallest cube for which exactly five permutations of its digits are cube.<br />
<br />
Solution:<br />
<haskell><br />
import Data.List<br />
import Data.Maybe<br />
a = map (^3) [0..10000]<br />
b = map (sort . show) a<br />
c = (filter ((==5) . length) . group . sort) b<br />
d = findIndex (==(head (head c))) b<br />
problem_62 = (toInteger (fromJust d))^3<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=63 Problem 63] ==<br />
How many n-digit positive integers exist which are also an nth power?<br />
<br />
Solution:<br />
<haskell><br />
problem_63=length[x^y|x<-[1..9],y<-[1..22],y==(length$show$x^y)]<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=64 Problem 64] ==<br />
How many continued fractions for N ≤ 10000 have an odd period?<br />
<br />
Solution:<br />
<haskell><br />
import Data.List<br />
<br />
problem_64 =length $ filter id $ map solve $ [2..9999] \\ (map (^2) [2..100])<br />
<br />
solve n = even $ length $ cont n 0 1<br />
<br />
cont :: Int -> Int -> Int -> [Int]<br />
cont r n d = m : rest<br />
where<br />
m = truncate ((sqrt (fromIntegral r) + fromIntegral n ) / fromIntegral d)<br />
a = n - d * m<br />
rest = if d == 1 && n /= 0<br />
then []<br />
else cont r (-a) ((r - a ^ 2) `div` d)<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=65 Problem 65] ==<br />
Find the sum of digits in the numerator of the 100th convergent of the continued fraction for e.<br />
<br />
Solution:<br />
<haskell><br />
import Data.Char<br />
import Data.Ratio<br />
<br />
e = [2] ++ concat [ [1, 2*i, 1] | i <- [1..] ]<br />
<br />
fraction [x] = x%1<br />
fraction (x:xs) = x%1 + 1/(fraction xs)<br />
<br />
problem_65 = sum $ map digitToInt $ show $ numerator $ fraction $ take 100 e<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=66 Problem 66] ==<br />
Investigate the Diophantine equation x<sup>2</sup> − Dy<sup>2</sup> = 1.<br />
<br />
Solution:<br />
<haskell><br />
intSqrt :: Integral a => a -> a<br />
intSqrt n<br />
| n < 0 = error "intSqrt: negative n"<br />
| otherwise = f n<br />
where<br />
f x = if y < x then f y else x<br />
where y = (x + (n `quot` x)) `quot` 2<br />
problem_66 = <br />
snd$maximum [ (x,d) | <br />
d <- [1..1000],<br />
let b = intSqrt d,<br />
b*b /= d, -- d can't be a perfect square<br />
let (x,_) = pell d b b <br />
]<br />
<br />
pell d wd b = piter d wd b 0 1 0 1 1 0<br />
piter d wd b i c l k m n <br />
| cn == 1 = (x, y)<br />
| otherwise = piter d wd bn (i+1) cn k u n v<br />
where <br />
yb = (wd+b) `div` c<br />
bn = yb*c-b<br />
cn = (d-(bn*bn)) `div` c<br />
yn | i == 0 = wd<br />
| otherwise = yb<br />
u = k*yn+l -- u/v is the i-th convergent of sqrt(d)<br />
v = n*yn+m<br />
(x,y) | odd (i+1) = (u*u+d*v*v, 2*u*v)<br />
| otherwise = (u,v) <br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=67 Problem 67] ==<br />
Using an efficient algorithm find the maximal sum in the triangle?<br />
<br />
Solution:<br />
<haskell><br />
problem_67 = readFile "triangle.txt" >>= print . solve . parse<br />
parse = map (map read . words) . lines<br />
solve = head . foldr1 step<br />
step [] [z] = [z]<br />
step (x:xs) (y:z:zs) = x + max y z : step xs (z:zs)<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=68 Problem 68] ==<br />
What is the maximum 16-digit string for a "magic" 5-gon ring?<br />
<br />
Solution:<br />
<haskell><br />
import Data.List<br />
permute [] = [[]]<br />
permute list = <br />
concat $ map (\(x:xs) -> map (x:) (permute xs))<br />
(take (length list) <br />
(unfoldr (\x -> Just (x, tail x ++ [head x])) list))<br />
problem_68 = <br />
maximum $ map (concat . map show) poel <br />
where<br />
gon68 = [1..10]<br />
knip = (length gon68) `div` 2<br />
(is,es) = splitAt knip gon68<br />
extnodes = map (\x -> [head es]++x) $ permute $ tail es<br />
intnodes = map (\(p:ps) -> zipWith (\ x y -> [x]++[y])<br />
(p:ps) (ps++[p])) $ permute is<br />
poel = [ concat hs | hs <- [ zipWith (\x y -> [x]++y) uitsteeksels organen |<br />
uitsteeksels <- extnodes, organen <- intnodes ],<br />
let subsom = map (sum) hs, length (nub subsom) == 1 ]<br />
</haskell><br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=69 Problem 69] ==<br />
Find the value of n ≤ 1,000,000 for which n/φ(n) is a maximum.<br />
<br />
Solution:<br />
<haskell><br />
{-phi(n) = n*(1-1/p1)*(1-1/p2)*...*(1-1/pn)<br />
n/phi(n) = 1/(1-1/p1)*(1-1/p2)*...*(1-1/pn)<br />
(1-1/p) will be minimal for a small p and 1/(1-1/p) will then be maximal<br />
-}<br />
primes=[2,3,5,7,11,13,17,19,23]<br />
problem_69=<br />
maximum [c|<br />
a<-[1..length primes],<br />
let b=take a primes,<br />
let c=product b,<br />
c<10^6<br />
]<br />
</haskell><br />
<br />
Note: credit for arithmetic functions is due to [http://www.polyomino.f2s.com/ David Amos].<br />
<br />
== [http://projecteuler.net/index.php?section=problems&id=70 Problem 70] ==<br />
Investigate values of n for which φ(n) is a permutation of n.<br />
<br />
Solution:<br />
<haskell><br />
import Data.List<br />
isPerm a b = (show a) \\ (show b)==[]<br />
flsqr n x=x<(floor.sqrt.fromInteger) n<br />
pairs n1 = <br />
maximum[m|a<-gena ,b<-genb,let m=a*b,n>m,isPerm m$ m-a-b+1]<br />
where<br />
n=fromInteger n1<br />
gena = dropWhile (flsqr n)$ takeWhile (flsqr (2*n)) primes<br />
genb = dropWhile (flsqr (div n 2))$ takeWhile (flsqr n) primes<br />
<br />
problem_70= pairs (10^7)<br />
</haskell></div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/61_to_70&diff=18785Euler problems/61 to 702008-01-29T21:50:12Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/51_to_60&diff=18784Euler problems/51 to 602008-01-29T21:46:59Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/41_to_50&diff=18783Euler problems/41 to 502008-01-29T21:46:42Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/71_to_80&diff=18782Euler problems/71 to 802008-01-29T21:46:17Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/81_to_90&diff=18781Euler problems/81 to 902008-01-29T21:46:02Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/91_to_100&diff=18780Euler problems/91 to 1002008-01-29T21:45:48Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/101_to_110&diff=18779Euler problems/101 to 1102008-01-29T21:45:32Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/111_to_120&diff=18778Euler problems/111 to 1202008-01-29T21:45:10Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/121_to_130&diff=18777Euler problems/121 to 1302008-01-29T21:44:49Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/131_to_140&diff=18776Euler problems/131 to 1402008-01-29T21:44:38Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/141_to_150&diff=18775Euler problems/141 to 1502008-01-29T21:44:02Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/151_to_160&diff=18774Euler problems/151 to 1602008-01-29T21:43:45Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/161_to_170&diff=18773Euler problems/161 to 1702008-01-29T21:43:20Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/31_to_40&diff=18772Euler problems/31 to 402008-01-29T21:43:05Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/21_to_30&diff=18771Euler problems/21 to 302008-01-29T21:42:50Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/171_to_180&diff=18770Euler problems/171 to 1802008-01-29T21:42:08Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/11_to_20&diff=18769Euler problems/11 to 202008-01-29T21:39:51Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/1_to_10&diff=18768Euler problems/1 to 102008-01-29T21:39:35Z<p>Marypoppins: </p>
<hr />
<div>Do them on your own!</div>Marypoppinshttps://wiki.haskell.org/index.php?title=Euler_problems/131_to_140&diff=18767Euler problems/131 to 1402008-01-29T21:35:57Z<p>Marypoppins: </p>
<hr />
<div>== [http://projecteuler.net/index.php?section=view&id=131 Problem 131] ==<br />
Determining primes, p, for which n3 + n2p is a perfect cube.<br />
<br />
Solution:<br />
<br />
== [http://projecteuler.net/index.php?section=view&id=132 Problem 132] ==<br />
Determining the first forty prime factors of a very large repunit.<br />
<br />
Solution:<br />
<br />
== [http://projecteuler.net/index.php?section=view&id=133 Problem 133] ==<br />
Investigating which primes will never divide a repunit containing 10n digits.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=134 Problem 134] ==<br />
Finding the smallest positive integer related to any pair of consecutive primes.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=135 Problem 135] ==<br />
Determining the number of solutions of the equation x2 − y2 − z2 = n.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=136 Problem 136] ==<br />
Discover when the equation x2 − y2 − z2 = n has a unique solution.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=137 Problem 137] ==<br />
Determining the value of infinite polynomial series for which the coefficients are Fibonacci numbers.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=138 Problem 138] ==<br />
Investigating isosceles triangle for which the height and base length differ by one.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=139 Problem 139] ==<br />
Finding Pythagorean triangles which allow the square on the hypotenuse square to be tiled.<br />
<br />
Solution:<br />
== [http://projecteuler.net/index.php?section=view&id=140 Problem 140] ==<br />
Investigating the value of infinite polynomial series for which the coefficients are a linear second order recurrence relation.<br />
<br />
Solution:</div>Marypoppins