The Wolfram Demonstrations Project is a free service with over twelve-hundred dynamically interactive examples of math, science, and physics. Levels of complexity range from elementary school level to graduate physics. Each example has code associated with it.
Lovers of Mathematica, a marvelous mathematical modeling application, will recognize Wolfram as the maker of that fine software. Mathematica itself includes thousands of original algorithms, spanning applied uses that range “from simple calculator operations and educational demonstrations to large-scale systems deployment and maximum-power supercomputing.”