Spiral matrices pairs of consecutive elements accumulate? nah too basic some nice list comprehensions perhaps product of lists, Haskell comparison permutation implemented via recursion and generators (link to generators tut) “next permutation”? both product and permutation from library - compare sources?