The first, 40, terms of the sequence enumerating permutations of length n suc\ h that pi[i+6]-pi[i] is never 6 are [1, 2, 6, 24, 120, 720, 4920, 37488, 319644, 3033264, 31784280, 364902480, 4538652840, 61102571376, 885045657564, 13722397569072, 226742901078120, 3977354871110160, 73816786920489720, 1444940702597713008, 29750236302549282948, 642693417769786746864, 14535097378893765189240, 343437047642562028552080, 8462159221483607741355240, 217058738026004962847383728, 5786962567831579779470339100, 160128502445222440732972796400, 4592452781535034288371178753320, 136343280150947006461513508855760, 4185311581132447162603024228097880, 132694329443246698408448358899760816, 4340734289338815557327414134657155924, 146367115445626267993586873411844272688, 5082781953788490662193307110992472897240, 181621838046071385634617423863860872183120, 6672600066703796190024884102084852552358120, 251856702941793193891091324971698132180278640, 9759596377265933158678288301015279255233123068, 388002811128164279929178134769493739939953127728] --------------------------------- This took, 236.454, seconds.