This is a linkpost for the original article hosted on my old blog: Bacon numbers via Recursive SQL.