I enjoy the mental kick you get from having a "eureka" moment while programming, or gaining a deeper insight into math and logic through their applications. It's also very rewarding when are struggling for hours with a tricky operation, and suddenly your code starts outputting valid answers.
I recently finished implementing an algorithm that finds the longest common subsequence of two strings, based on the Robinson–Schensted–Knuth correspondence, and I was amazed that my code actually worked. The fact that I can use programming to automate difficult math is definitely my favourite part
_________________
The scientist only imposes two things, namely truth and sincerity, imposes them upon himself and upon other scientists - Erwin Schrodinger
Member of the WP Strident Atheists