Primes
- Primes by trial division in C
- Primes by sieve in C
- Primes by sieve in Commodore 64 Assembler
- Primes by sieve in Python
- Primes by sieve using wheel factorization in C
- Mersenne primes using the Lucas-Lehmer method in C
- Fermat’s Little Theorem in C
- Density of primes in Python
- Twin primes of arbitrary length in Python
- Palindromic primes of arbitrary length in Python
- Explore anti-sameness bias in primes in Python
Ordinary Differential Equations
Newton-Cotes formulae for area under a curve in C
Each method integrates the curve f(x) = 5x^3 – 12x^2 + 7x – 3, and the integration is carried out from x = 2 to x = 6. The analytic answer is area = 868.00. The eight methods represented here are the eight Newton-Cotes formulae – four open and four closed.
- The trapezoid rule is the first degree closed Newton-Cotes formula.
- Simpson’s rule is the second degree closed Newton-Cotes formula.
- Simpson’s 3/8 rule is the third degree closed Newton-Cotes formula.
- Boole’s rule is the fourth degree closed Newton-Cotes formula.
- The rectangle rule is the second degree open Newton-Cotes formula.
- The trapezoid method is the third degree open Newton-Cotes formula.
- Milne’s rule is the fourth degree open Newton-Cotes formula.
- The fifth degree open Newton-Cotes formula has no name
Various