Tucker Balch, a computing professor at Georgia Tech, blames the decline in computer science students in part on what he calls the "prime number" syndrome. According to this AP article the Prime Number Syndrome is:
It's the traditional way to teach computer science students by asking them to write programs that spit out prime numbers, the Fibonacci sequence or other mathematical series.
In short part of the problem with computer science courses is that they are too much about the math. Students are not all interested in the math. That may be partially a result of computer science courses originating from math or engineering departments. A lot of the people in the early years of computer science came out of mathematical traditions. Math was/is interesting to them so that is how they teach computer science. Some of the problem today may be that not everyone thinks that calculating prime numbers is really that exciting. They are interested in a lot of other problems though.
Some computer science departments are realizing this and are bringing other disciplines into the mix earlier in the program. At some places it is robotics. In some game development. In still others there is this new idea of "media computation" programs. There are a growing number of computational biology programs as well. These programs are all about getting students interested by expanding beyond just doing the math.
Now at some point most computer science majors wind up needing more math classes. And there are a lot of concepts that computer scientists use that are related to mathematical concepts. But the days when we need to weed out students early by forcing them to fit the mold of pure math interests are long gone.
A lot of high school computer science teachers also teach math these days. In fact in some states a math certification is required to teach computer science. I guess I was a rarity though. I'm never been a real mathematician and while I assigned the odd Fibonacci sequence a lot of the projects I came up with on went in other directions. I like the idea of the robotics curriculum they are developing at Georgia Tech. But I'm a robot sort of guy. I'm sure the media computation and bioengineering programs also attract a lot of fans. I tend to think that at the high school level, especially for a very first course, what you might want is a lot of variety. The more different disciplines that come into play the more likely you are to catch the interest of more students. And to me, getting students interested is a major goal of a first programming course.