No, we want a nice discrete function. The Möbius function[1] μ(x) has some potentially useful properties - it produces discrete values in the range [-1,1], and it has a kind of pseudorandomness to its output. Some sort of variation on 30 + μ(n + x) or 30 - μ(n + x) should produce the right values for the number of days per month in a leap year. 30 - μ(x+192)[2] starts off promisingly, giving the right day counts for January through to July, but then it goes off the rails. I've mounted a quick brute-force search, but it looks like there's no n < 1000000 for either of those formulations that correctly matches January through August, let alone through to December, but never mind: there's plenty more natural numbers. Surely someone will find a formulation that works. It's not like anyone's been mistaken about the continuation of this number series before[3].
I don't want that, but you can always get there by replacing x by floor(x) everywhere it occurs, or, in strongly typed languages, by declaring the function to take an integer value.
For those that dislike taking powers of x, try this in Python:
[1] http://en.wikipedia.org/wiki/M%C3%B6bius_function [2] http://www.wolframalpha.com/input/?i=30+-+%CE%BC%28n%2B192%2... [3] http://en.wikipedia.org/wiki/Mertens_conjecture