Note quite as legible, but I wanted to generate the list on the fly, rather than mutating an existing list. The nested comprehension was necessary to flatten the list (and avoid creating an empty list only to extend it).