There is an exact solution that accounts for the probability of the overlaps in the spacing between birthdays, but the explanation of how that's accomplished would be a little math intensive and there's already more than enough math in this post. Just take my word for it that the total possible permutations of n people's birthdays spaced at least k days apart from each other is equal to:
With this result we can move on to calculating the probability that no birthdays in a group of n random people are within k days of each other. Subtract that from 1 and you get the the probability that there is at least one birthday in the group within k days of another person's. That equation looks like this:
It looks more complicated than the formula for probability of same-day birthdays, but the general form is the same. It converges to 1 pretty rapidly as n increases. And the larger k is, the faster it converges. If we take k = 0, the equation reduces to the earlier expression for birthdays on the same day. In the graph and table below you can see the results for yourself.
As you can see, among just 10 people there's a pretty good chance there are two or more birthdays in the same week. What I think is pretty cool is the huge difference between k = 0 and k = 1. For instance, in a group of 25 people, there's about 57% probability that two people have the same birthday, but almost 93% probability that two people have birthdays within one day of each other (i.e. on the same day or on consecutive days). Test it out among your co-workers or a sample of your Facebook friends and see for yourself. If you're clever, you might even be able to use this knowledge to make some bets and relieve a few naive people of their money.