I compiled a bunch of articles related to the subject:
Cool Coursera Course: PreCalculus
Course Description
This course is designed to prepare you for a collegelevel Calculus course. Through this course you will acquire a solid foundation in algebra and trigonometry. Emphasis is placed on understanding the properties of linear, polynomial, rational, radical, piecewise, exponential, logarithmic, and trigonometric functions. You will learn to work with various types of functions in symbolic, graphical, numerical and verbal form.
This course will be taught over ten weeks, with materials released on a weekly basis. Each week will consist of a series of short lecture videos, quizzes every 35 lectures, readings and homework assignments through which you can practice your mastery of the material.
A prerequisite background in Introductory Algebra and Basic Geometry is necessary for this course.
Project Euler: Solution to Problem 6
The sum of the squares of the first ten natural numbers is,
1^{2} + 2^{2} + … + 10^{2} = 385.
The square of the sum of the first ten natural numbers is,
(1 + 2 + … + 10)2 = 552 = 3025.
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 âˆ’ 385 = 2640. Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
On my previous post about how to solve problem 1 we saw that it is possible to represent a summation of all the natural numbers in a polynomial form.
You could solve this problem pretty much the same way you solved problem 1, using brute force:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 

Doing a little bit of research, we could discover that this problem was solved back in 1631 by Johann Faulhaber, who published the general formula to the power sum of the first n positive integers:
Also know as square pyramidal numbers, it is possible to express the sum of powers of 2 as:
That can be translated to the following Ruby code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 

If you see any flaw with that solution, or ways to improve it, please send me a pull request!
Project Euler: Solution to Problem 2
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the evenvalued terms.
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrent relation:
With the seed values:
A recursive algorithm
In general, any recursive algorithm such as the Fibonacci gives us a recurrence relation.
The Fibonacci formula seems to give us a natural example of recursion:
1 2 3 4 5 

The complexity of a naive recursive Fibonacci is 2^{n}, since in each step you call the function F twice:
Given that, the worse way to solve that problem would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 

We could do a simple optimization, and calculate only the evenvalued fibonacci numbers. Given F(3) = 2, F(6) = 8, F(9) = 34 and F(12) = 144, then:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 

Dynamic Programming
The reason why our previous recursive algorithm is slow is because it keeps recomputing the same subproblems over and over again. You could avoid that problem by using a simple memoization algorithm that will help us avoid wasting effort computing every subproblem again.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 

Matrix Multiplication
This is basically a mathematical trick with matrices. That matrix generates the F(n) and F(n+1) terms of the Fibonacci sequence:
The formula for multiplying two symmetric 2x2 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 

This algorithm is based on the idea of exponentiation by squaring and It turns out that this solves in O(log n).
If you see any flaw with that solution, or ways to improve it, please send me a pull request!
Project Euler: Solution to Problem 1
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
The thing with Project Euler is that there is usually an obvious brute force way to solve the problem, which will take about forever! As the questions become more difficult, you will need to implement clever solutions.
This problem is easily solvable using the following Ruby code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 

The problem with solving the problem that way is that you need to iterate over every single number between 0 and 999. Given that, the complexity of this code is O(n).
There is a better way to solve that problem using proper Math, and with a complexity of O(1) (assuming arithmetic operation are implemented in O(1)).
In combinatorial mathematics, the Inclusionâ€“exclusion principle is a counting technique, which generalizes the familiar method of obtaining the number of elements in the union of two finite sets, symbolic expressed as:
The value of the summation can be found without performing a thousand iterations, since it can be shown (for instance by mathematical induction) that the number of elements in the union of two finite sets, symbolic expressed as:
Let’s try to prove that using a small problem:
Find the sum of all the multiples of 3 or 5 below 20.
if we list, by hand, all the natural numbers below 20 that are multiples of 3 or 5, we get: 3, 5, 6, 9, 10, 12, 15 and 18. The sum of these multiples is 78.
Now, let’s apply the previous formula to solve that:
Now that we know that this formula works, it can be translated to the following Ruby code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 

If you see any flaw with that solution, or ways to improve it, please send me a pull request!