In Or ha-Sekhel, the Kabbalist Abraham Aboulafia prescribes a systematic way to run through every arrangement of the letters of a word. With only two or three simple rules, he describes what we would now call a recursive algorithm for generating permutations.