I'm OK with this (with caveats).
When I completed a B.S. in Math in the early 1990s, I had applied math (essentially computer science courses with a fair bit of programming) courses count towards the major. I also had math-heavy physical science courses count towards the math major. (If memory serves, those courses were modern physics, statistical mechanics, and physical chemistry).
My caveat is a concern others have stated above: programming is not computer science. However, I think every CS course I've taken (I did a CS Master program with completed courses but not the thesis) had programming homework to demonstrate the CS concepts.
So not only do I think this could work, but it's a good idea in 2 scenarios:
1. As someone noted above, programming covers algebraic concepts such variables. A specifically-constructed course to teach algebra through programming is not a bad idea.
2. I know this is not as true today, but when dinosaurs roamed the earth and I was in high school, all math tracts lead to calculus. There is more in the world of math that does not include calculus. I could see a divide in tracts where students get to that level and have a choice to take calculus or CS which is heavy in discrete math (or both).
What would not work is a straight swap of the typical intro to [language] course in place of a first year of trigonometry or geometry. Also note for those CS and applied math courses I took, none of them taught any programming during lecture or in the texts/notes provided as part of the course. If programming was required to complete homework, we were expected to know/learn on our own the required language.
CS is not substitute for introductory math and math is not a substitute for introductory CS. My second example above (CS as a discrete math course) really only works if students already have some programming experience (assuming as with courses I've taken programming is required for demonstration of the CS concepts).