pzuehlke / Project-Euler-Solutions

Solutions in Python 3 to the first 100 problems on Project Euler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Euler Solutions

Table of Contents

  1. Solutions and auxiliary files
  2. Description of features
  3. Benchmark runtimes
  4. List of favorite problems
  5. Badge and friend key

Features

This repository contains solutions to each of the first 100 problems on Project Euler, written in Python 3 .

It also includes:

  • A module PE_UTILITIES.py comprising the most useful functions that I had to write to solve these problems. It is however not necessary to import it for any of the scripts to work.
  • A template SOLUTION_TEMPLATE.py for the solution scripts.
  • A folder AUXILIARY_FILES containing all text files linked to in the problem statements (among the first 100) or created by myself to avoid cutting and pasting large numbers, matrices, etc.. These files are named p0[0-9][0-9]_*.txt.

📝 Before running the solution to a problem involving an auxiliary file, it is necessary to move the latter to the same directory as the source code for the solution.

📝 Solutions to some of the problems beyond the first one hundred are stored in a private repository.

Benchmark runtimes

All of the solutions are original (in the sense of not having been taken from someone else). The following among them take more than one second to execute on my computer:

Problem number Runtime (approx.)
14 1.6 s
23 2.5 s
34 2.4 s
41 1.9 s
43 3.0 s
60 23 s
73 5.7 s
74 2.0 s
78 4.9 s
82 1.1 s
86 1.4 s
93 4.6 s
95 6.8 s
96 3.2 s
98 2.7 s

List of favorite problems (so far)

031: Coin sums
059: XOR decryption
078: Coin partitions
081, 082 and 083: Path sum: two, three and four ways
084: Monopoly odds
096: Su Doku
113: Non-bouncy numbers
126: Cuboid layers
144: Investigating multiple reflections of a laser beam
147: Rectangles in cross-hatched grids
148: Exploring Pascal's triangle
151: Paper sheets of standard size
155: Counting Capacitor Circuits
158: Exploring strings for which only one character comes lexicographically after its neighbour to the left
164: Numbers for which no three consecutive digits have a sum greater than a given value
178: Step numbers
181: Investigating in how many ways objects of two different colours can be grouped
185: Number Mind
191: Prize strings
202: Laserbeam
208: Robot walks
259: Reachable Numbers
265: Binary Circles
267: Billionaire
277: A Modified Collatz sequence
301: Nim
317: Firecracker
323: Bitwise-OR operations on random integers
329: Prime Frog
345: Matrix Sum
371: Licence plates
607: Marsh Crossing

Badge and friend key

Friend key: 1912870_zicXUiSA5Mv6wAvcZOOv8FMAfCtCClsu

Badge

About

Solutions in Python 3 to the first 100 problems on Project Euler

License:GNU General Public License v3.0


Languages

Language:Python 100.0%