I like writing games where a human plays against the computer, and the computer uses mathematics to calculate its moves.
I have written two such games: phpNIM and Bridj-It
They can be seen at:
http://www.uksites4all.co.uk/development along with a couple of other funky scripts.
phpNIM was the easiest to program, as the computer's move is calculated using simple binary arithmetic.
Bridj-It (a version of GALE) was much more complicated as it requires the solution of a number of simultaneous linear equations with 21 unknowns. This was done using matrix algebra with gaussian elimination. The graphics are all done in html and css.