Prime Factorization
A Python prime-factorization routine built on trial division and a Sieve of Eratosthenes-generated prime list.
Tag
Writing about Algorithms.
A Python prime-factorization routine built on trial division and a Sieve of Eratosthenes-generated prime list.
Comparing Python methods for generating Fibonacci terms, recognizing valid terms, and finding their indices.
Fibonacci identities, negative indices, the Golden ratio, and formulas for generating, indexing, and recognizing terms.
A C implementation of uniform binary search that uses a precomputed lookup table to reduce index calculations.
An explanation of binary search with iterative and recursive Python implementations and logarithmic complexity.
Python implementations of linear search, including iterative, recursive, reverse, sentinel, and ordered-list variants.
Two Python approaches to finding the greatest product of four adjacent values in the Project Euler problem 11 grid.
Comparing trial division and the Sieve of Eratosthenes for summing primes below two million in Java.
An explanation and Java implementation of the Sieve of Eratosthenes for generating prime numbers below a limit.
Comparing brute force with Euclid’s formula for the Pythagorean triplet in Project Euler problem 9.
A Python sliding-window solution for the greatest product of five consecutive digits in Project Euler problem 8.
Comparing two Python primality tests while finding the 10,001st prime for Project Euler problem 7.
Five Python primality tests, progressing from trial division through the 6k ± 1 optimization.
Using summation formulas to solve Project Euler problem 6, with proofs for the sums of natural numbers and their squares.
Solving Project Euler problem 5 in Python with a divisibility test and a GCD-based least common multiple.
Comparing brute-force and divisibility-based Python solutions for the largest palindromic product of two three-digit numbers.
Two Python solutions to Project Euler problem 3: the Unix factor command and a portable largest-prime-factor algorithm.
A faster solution to Project Euler problem 2 that generates only the even Fibonacci terms needed for the sum.
A Python and Java solution to Project Euler problem 2 that uses the Golden ratio to step between even Fibonacci terms.
Solving Project Euler problem 1 with inclusion-exclusion and arithmetic-series formulas in Python, Java, Perl, C++, and Ruby.