
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Master practical algorithms with Project Euler by breaking complex problems into smaller parts, exploring solutions and optimizations, then coding in Python (and JavaScript) to build creative, scalable solutions.
Explore how the course is organized, with breakdowns followed by solutions, from easy starter problems to advanced Euler challenges, including Python, Node.js, and JavaScript solutions, and optional utilities videos.
Explore Project Euler problem 1 by summing multiples of 3 or 5 below 1000 in Python, using a for loop and modulus checks.
Solve Project Euler problem two by iterating the Fibonacci sequence with a while loop, summing even terms under four million using a running total and modulo checks.
Code a Python solution for Project Euler problem 2, computing Fibonacci numbers less than four million and summing the even terms with a while loop and modulo two check.
Find the largest prime factor of a huge number from Project Euler problem three using Python, with factors, primes, and modulus-based checks.
Learn to optimize prime factorization by checking divisors only up to the square root and using paired factors in Python, dramatically speeding up Project Euler problem solving.
Learn to find the largest palindromic product of two three-digit numbers using Python. Build nested loops from 100 to 999, check palindromes, and track the maximum.
Explore solving Project Euler problem 4 in Python by generating the product of two three-digit numbers, checking palindromes, and profiling time to optimize loops for performance.
Explore solving the smallest multiple problem (1–20) with a brute-force approach, using a while loop and a divisibility-check function to verify divisibility by all numbers from 1 to 20.
Build a Python solution to project euler problem 5 by checking divisibility by 1 to 20, timing the code, and applying optimizations like stepping by 20 and reversing checks.
Break down problem six by computing the sum of squares and the square of sums, then take their difference, demonstrated with 1-10 and a Python loop for 1-100.
Compute the difference between the square of the sum and the sum of the squares for numbers 1 to 100 using Python.
Demonstrate a node.js approach to project euler problem 6 by computing the sum of squares and the square of the sum with a for loop, then log the difference.
Explore brute-force and optimized approaches to find the 10,001st prime, using a known primes list, modulus checks, and the sieve of Eratosthenes concept to prune non-primes.
Learn how to solve Project Euler problem 7 in Python by building a prime finder with known primes, comparing brute force checks to a sieve-based approach, and timing the run.
Solve project euler problem 7 by iterating primes with a known primes list in node/javascript, testing divisibility, and optimizing with a prime-of-known-primes approach for faster results.
Find largest product of thirteen consecutive digits in a 1000-digit number from Project Euler, using strings or lists and a subset of 13 digits with zero checks and divide‑and‑multiply optimization.
Apply a Python solution to Project Euler 8 by extracting thirteen adjacent digits from a large number, computing their product via a sliding window, and optimizing with zero checks.
We break down finding a pythagorean triplet with a+b+c=1000 using a and b loops. Compute c=1000-a-b, check a^2+b^2=c^2, and multiply a, b, and c.
Explore a Python brute-force solution to Project Euler problem 9, finding a, b, c with a^2 + b^2 = c^2 and c = 1000 - a - b.
Apply the sieve of Eratosthenes to sum all primes below two million, starting at the square of each prime to improve efficiency and relate it to the earlier problem.
Implement a Python sieve of Eratosthenes to sum primes below two million. Compare naive and optimized approaches and demonstrate dramatic speedups in Project Euler problem 10.
Learn to compute the largest product of four adjacent numbers in a 20x20 grid using Python with nested loops across horizontal, vertical, normal diagonal, and reverse diagonal directions.
Master the problem 11 solution in Python by parsing a 20x20 grid into a list of lists, then compute the largest product of four adjacent numbers horizontally, vertically, and diagonally.
Explore triangular numbers and their divisors to find the first with over 500 divisors in Project Euler problem 12, using the square-root optimization to count factors efficiently.
Apply Python to solve Project Euler problem 12 by finding the first triangular number with at least 500 divisors, using factorization, square-root optimization, and efficient looping.
Solve a large-sum challenge by looping through 100 fifty-digit numbers, casting data types, and grabbing the first ten digits of the 52-digit sum via a substring.
This lecture walks through solving Project Euler problem 13 in Python by parsing a 150-digit string, converting to integers, summing 100 numbers, and printing the first ten digits.
Solve Project Euler problem 14 by finding the starting number under 1 million that yields the longest Collatz sequence, using memoization and efficient data types to speed up calculation.
Solve project euler problem 14 in Python by finding the starting number under 1 million that yields the longest collatz chain, using a dictionary to store computed chain lengths.
Solve Project Euler problem 15 by counting lattice paths on a 2x2 and 20x20 grid with a simple pattern; implement a Python dynamic programming grid.
This lecture solves Project Euler problem 15 in Python by building a dynamic programming grid and updating each cell as the sum of top and left neighbors to count routes.
Solve problem 16 by summing digits of 2 to the 1000th power, using Python's arbitrary-precision integers and converting the number to a string to sum its digits.
Compute 2 to the 1000th power in Python, convert the result to a string, and sum its digits to obtain 1366. Shows 302 digits and Python's big integers.
Explore problem 17 by looping through numbers up to 1000 and counting letters in their English names using string manipulation, ignoring hyphens and spaces.
Demonstrates solving Project Euler problem 17 in Python by building a number list from digits, tens, and hundreds with and, then counting letters without spaces or hyphens to yield 21124.
we break down problem 18 from Project Euler by solving the triangle maximum path sum with a bottom-up dynamic approach that uses triangular subproblems instead of brute force.
Parse the Project Euler triangle in Python, convert rows to integers, and compute maximum path sum from bottom to top by choosing the larger between down left and down right.
Solve Project Euler problem 19 by counting how often the first day of each month falls on Sunday from 1901 to 2000, using the Gregorian calendar and a 28-year cycle.
Compute the number of Sundays on the first of the month from 1901 to 2000 using a Python script, handling leap years and month lengths.
Demonstrate calculating the sum of digits of a 100 factorial using Python's math.factorial. Convert the result to a string, iterate digits, and accumulate the total to obtain the digit sum.
Explore solving problem 20 in Python by computing 100 factorial, converting it to a string, and summing its digits with loops or map and sum to yield 648.
Explore amicable numbers and their pairs, define proper divisors, and apply a two-part approach under 10,000 using divisor sums and a sieve optimization.
Explore Python solutions to Project Euler problem 21, deriving amicable numbers through divisor analysis, sqrt-based optimization, and a fast sieve approach for massive scale.
Explore Project Euler problem 22: compute names scores by summing letter values and multiplying by sorted position, comparing radix sort with built-in sorted, using ord in Python.
Explore solving Project Euler problem 22 with a Python radix sort approach, reading and cleaning a names file, sorting uppercase names, and computing name scores by letter values times positions.
Explore problem 23 from Project Euler by using a sieve to compute proper divisors and identify abundant numbers, then sum numbers not expressible as a sum of two abundant numbers.
Python solution to Project Euler problem 23 using a sieve to generate abundant numbers and proper divisors, identifying numbers not expressible as the sum of two abundant numbers.
Find the first Fibonacci number with 1000 digits by tracking only the two previous values in a Python loop using big integers; the solution yields Fibonacci number 4782.
Explore project Euler problem 26: determine the longest repeating decimal cycle for 1/n up to 1000 using long division and remainder tracking, with optimizations that skip factors 2 and 5.
Are you looking to enhance your programming skills and take your problem-solving abilities to the next level? Welcome to Mastering Algorithms: Solving Project Euler Challenges, a comprehensive course designed to help developers and enthusiasts alike sharpen their coding skills through engaging and challenging algorithmic problems.
In my experience, there's nothing that competes with using the basics in a creative, clever way. Although I forgot most of my algebra and math theory as soon as I got out of school, I've found that this knowledge is incredibly valuable for becoming a better programmer and writing more efficient, scalable, and optimal solutions!
Course Structure: Each video is dedicated to a single Project Euler problem. In the first half, we will be on the board, breaking down the problem (as they get very tricky to understand as we progress). In the second half, we will implement solutions and often find ways to optimize them. Currently, all problems videos use Python, for implementation because it is the most ubiquitous language for this kind of work. I am adding JavaScript/Node slowly. Even if you are a C, Java, or PHP developer, you will be able to follow the problem breakdown and have a good chance of understanding the Python code. If not, you’ll still be able to solve the problems on your own!
What You’ll Get:
In-Depth Lessons: Each video is carefully crafted to guide you through the intricacies of different problems, from basics to advanced topics. When I started, I couldn't find a consistent source for this material, so I've created one for you!
Interactive Coding Exercises: Put your knowledge to the test with hands-on coding exercises and detailed walkthroughs.
Community Support: Access to the Q&A section where you can post your solutions or get help when you're stumped. Collaborate with other like-minded learners who are eager to tackle these challenges.
Expert Guidance: Benefit from my experience and insights as I help you navigate through each problem and develop effective solutions.
By the end of this course, you’ll not only have solved numerous Project Euler problems but also gained a deeper understanding of algorithms and a robust skill set that will serve you well in your programming career. Enroll now and start your journey to becoming a master problem-solver!