This is my scratch pad and progress bookmark for ProjectEuler.net problems.
- I am using this to practice and learn
Golang
. I will look up and implementgolang
functionalities as I encounter a programming needs. - This is fun because after one solves the challenge, one can view the alternative solutions and learn "other ways to skin a cat".
Spoilers !!!
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve.
"Project Euler exists to encourage, challenge, and develop the skills and enjoyment of anyone with an interest in the fascinating world of mathematics."
-
Problems: projecteuler.net/archives
-
Offline copy:
- Enclosed is golang script which will scrape the probles off the
projecteuler.net
website for offline use.
Special math notations (Matlab/LaTex style notations) formatting may not get rendered properly onto the output text file.
- Enclosed is golang script which will scrape the probles off the
For me, this is an exercise in Golang. It is an interesting language because despite it being easier with faster rapid deployment than other mainstream languages, it is slower than others in peculiar areas. Something to do with "parallels and concurrency".
- play.golang.org
- run scripts
-
## demo problem 1 solution go run problem-01.go
-
- make-template.go will generate a blank starter template
- it will attempt to web scrape the problem statement
- dependency
go get github.com/PuerkitoBio/goquery
- Go math library:
include "math"
- I initially tried to avoid using it, but it makes more sence to use it.
Solutions for the first 100. The site asks users to not publicly share solutions beyond 100 outside of projecteuler.net.
10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
---|---|---|---|---|---|---|---|---|---|
1 | 11 | ||||||||
2 | 12 | ||||||||
3 | |||||||||
4 | |||||||||
5 | 15 | ||||||||
6 | |||||||||
7 | |||||||||
8 | |||||||||
9 | |||||||||
10 |
- For the problems whose calulations are slow or which have memory constraints, there is also a C equivalent.
- I am thinking of making multiple language version for the slow ones
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers.
positive discrete whole integer numbers, including zero
A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2.
sequence, such that each number is the sum of the two preceding ones
- copy highlighted text to system wide clipboard
- paste outside of vim
" highlight and yank the desired chars :call system("xclip -selection clipboard", @") "then paste to web browser or text editor
- mathschallenge.net