Here's something I think we both agree on: a lot of puzzles are just mathematics applied in counter-intuitive ways. As a result, some puzzles are bound to be more mathematical than logical, and others more logical than mathematical.
I think we should draw the line at "pure mathematics" - that is to say, $(x+1)(x-4)=-16$ is not a puzzle, but is a math problem. For instance, if the OP of the question had posted "What is the probability that N people have the same birthday?" I probably would have VTCd as off topic: it belongs on Mathematics or (less likely) Statistics (but shouldn't be migrated).
However, because the OP clearly found the problem from somewhere as a puzzle, I think the presentation of it as a puzzle qualifies it to be suitable for the site.
This definition isn't without limit. Stack Overflow, a long while ago, had a problem where people would post ridiculous questions and append "for programmers?" - This actually became known as boat programming, because of an infamous question entitled "What do I need to do in order to be a programmer out at sea?".
The reason I bring up boat programming here is that pretty much any math problem can be phrased as a puzzle. Instead of "What is the best [so-and-so] for programmers?" we might find ourselves with "How do I solve [insert math problem] as a problem?", and we need to watch out for it.
In other words:
Sally has four apples. She eats two and gives away one. How many apples does she have?
Is directly equatable with:
What is $4-2-1$?
Even though the first is (arguably) in puzzle form, it's still off-topic because it's just a math problem disguised with words.
The distinction for this question along this more subtle line is that the question seems very little to do with pure mathematics, and people reading the puzzle might not think to search for the "birthday problem" as it's canonically known. In other words: the question is genuinely a puzzle and isn't a math problem phrased as a puzzle.
A side note: at some point, we will have to go with the "I know it when I see it" rule. I don't think we've reached that point yet, and we certainly still have a bit of scope-refining to do, but we should bear in mind that we're dealing with abstract definitions such as "puzzle."