Book recommendations to start learning programming for project Euler

In summary, if you want to learn programming to solve problems from Project Euler, I recommend "Introduction to Scientific Programming with Python" by Springer.
  • #1
MidgetDwarf
1,531
674
I do not know much about programming. I have used Mathematica, and some Python in the past for very specific problems.
Any book recommendations for one wanting to learn programming in order to solve problems from Project Euler. I am familiar with number theory, but not with programming.
 
Physics news on Phys.org
  • #2
I share this with my students, its a free e book from springer
"Introduction to Scientific Programming with Python"
https://link.springer.com/book/10.1007/978-3-030-50356-7

For simpler projects I recommend them to use https://codewith.mu/

This might be of interest for you
https://www.sagemath.org/
Just google "number theory with sage" "abstract algebra with sage" etc and you'll find tons of material like these
 
  • Like
  • Informative
Likes vanhees71, berkeman and MidgetDwarf
  • #3
malawi_glenn said:
I share this with my students, its a free e book from springer
"Introduction to Scientific Programming with Python"
https://link.springer.com/book/10.1007/978-3-030-50356-7

For simpler projects I recommend them to use https://codewith.mu/

This might be of interest for you
https://www.sagemath.org/
Just google "number theory with sage" "abstract algebra with sage" etc and you'll find tons of material like these
Thanks for the great links. I was unaware of the existence of Sage.
I ordered a physical copy of the Springer book.
 
  • Like
Likes vanhees71 and malawi_glenn
  • #4
I have some more Sage stuff if you are interested and want to go down that route
 
  • Like
Likes vanhees71
  • #5
  • Like
Likes malawi_glenn and vanhees71
  • #6
malawi_glenn said:
I have some more Sage stuff if you are interested and want to go down that route
Do you think Sage would be useful for solving Project Euler problems?
 
  • #7
MidgetDwarf said:
I do not know much about programming. I have used Mathematica, and some Python in the past for very specific problems.
Any book recommendations for one wanting to learn programming in order to solve problems from Project Euler. I am familiar with number theory, but not with programming.
Can you list a few of the problems from Project Euler that you are interested in working on? That would help us in our recommendations, I think. Thanks.
 
  • #8
pbuk said:
Do you think Sage would be useful for solving Project Euler problems?
Rethorical question?
 
  • #9
malawi_glenn said:
Rethorical question?
Not at all. As I understand it, the aim of SageMath is to create an open source alternative to declarative math packages such as Matlab and Mathematica. If you look at the "leader board" for Project Euler there is only one entry for an Eulerian who declares that they use Mathematica.

Whilst some of the early problems can easily be solved using e.g. Mathematica in reasonable time e.g. https://projecteuler.net/problem=1, this leaves the "heavy lifting" to the package and does not give you the experience of efficiently reducing the size of the solution space that is necessary in solving many of the later problems.
 
  • #10
pbuk said:
"heavy lifting" to the package and does not give you the experience of efficiently reducing the size of the solution space that is necessary in solving many of the later problems.
Just because there are packages does not mean one has to use them. One could also use the packages to check the solution. I mean if you do not want to use the inbuilt "mod" function, just write your own :-)

EDIT: I guess GNU octave is still "good" these days. It is basically a free version of MATLAB
 
Last edited:
  • #11
Yes please, share more Sage stuff.

As for what problems I want to solve in Project Euler. I want to start from 1 going upwards. I see it more as practicing the number theory I know, and learning more, while learning a bit of python, or what ever language, in the process.
 

FAQ: Book recommendations to start learning programming for project Euler

What is Project Euler?

Project Euler is a series of challenging mathematical/computer programming problems that require more than just mathematical insights to solve. It is a great way for beginners to practice their programming skills and for experienced programmers to challenge themselves.

What is the best programming language to start with for Project Euler?

The best programming language to start with for Project Euler is one that you are comfortable with and have some experience in. Some popular languages for Project Euler include Python, Java, and C++. Ultimately, the best language for you will depend on your personal preference and the resources available to you.

Are there any recommended books for learning programming specifically for Project Euler?

Yes, there are several books that are specifically geared towards learning programming for Project Euler. Some popular options include "Project Euler: A Programming Odyssey" by Thomas Koshy and "Project Euler Solutions: A Functional Approach" by Jeff Erickson. However, any programming book that focuses on problem-solving and logic will be helpful for tackling Project Euler problems.

How do I approach solving a Project Euler problem?

The best way to approach solving a Project Euler problem is to break it down into smaller, more manageable parts. Start by understanding the problem and identifying any patterns or algorithms that may be useful. Then, write out a plan or pseudocode for your solution before writing any actual code. Finally, test and debug your code until you arrive at the correct solution.

Are there any online resources or forums for discussing Project Euler problems?

Yes, there are several online forums and communities dedicated to discussing Project Euler problems and solutions. Some popular options include the Project Euler forum, Reddit's r/projecteuler subreddit, and the Project Euler Discord server. These resources can be helpful for getting tips and advice from other programmers, as well as discussing different approaches to solving problems.

Back
Top