Generating functions for borders - Jan Snellman (2007)