I recently posted an algorithm question on SO and it was closed as a non-programming related. As far as I know, algorithms were always part of CS.
Look at your question I can honestly say that you should ask it at mathoverflow.net.
Does this mean that you can't ask any math question? I think no; you can ask math questions that are not too technical or specific, something like high school algebra or first year undergrad calculus are accepted, I think. Beyond that, I suggest you take it to mathoverflow.
Technically it's purely math related, but computer science is simply heavily applied math. I wouldn't vote to close because it is very clearly related to programming (i.e. it's for programming purposes). It wouldn't make sense to ask:
To find out whether N is a prime number, we only need to look for all numbers less than or equal to sqrt(N). Why is that? I am working as a carpenter and trying to understand the reasoning behind the floor plans.
Therefore, I would say it's okay for Stack Overflow.
As a proponent of leaving the question closed I suppose I should reply.
Not all questions belong in the Trilogy. To say "it doesn't belong on SU or SF, therefore it must belong on SO." isn't valid.
I do agree it's a thin line. But imagine if the question had no language attached and the user had simply asked "To find out whether N is a prime number, we only need to look for all numbers less than or equal to sqrt(N). Why is that?" I don't think anybody here would think it was programming related, because it's pure math. In the same manner saying "How do they make waffles look so tasty? Oh, because I'm programming a waffle simulator" doesn't suddenly make waffles programming related, I don't think "Why is pure math question X so? Oh, I'm implementing it" makes the question related to programming.
Yes, programming is applied mathematics, but it's the application we talk about, not the pure mathematics. I don't find saying "well then algorithms etc also aren't programming related since they are math" is valid either. They are programming related because we implement them. We take these algorithms and apply them. How can one "apply" why the minimum number to check is sqrt(N)?