------------------------------- The first, 50, terms of the sequence enumerating permutations of length n suc\ h that |pi[i+4]-pi[i]| is never 4 are [1, 2, 6, 24, 108, 544, 3264, 23040, 176832, 1563392, 15536160, 171172224, 2066033472, 27146652480, 385447394880, 5878028516736, 95776238793504, 1660164417866304, 30496085473606944, 591661117634375040, 12087628978334638752, 259353732110769122368, 5830260198084688642464, 137021386015707177170304, 3360010743290968081122336, 85815593755614101982027328, 2279036042450233133952884256, 62840368840653283623028196736, 1796479027449525226613390253600, 53178904377854650229426976022080, 1628051288320748404522677833251872, 51489834147711915696255366922024320, 1680524640401668637272455694703194656, 56547372705386908719277934365825328704, 1959857527316116398668031119325234583584, 69904522549737844112664196299204106773888, 2563897420094242139056537212761051006266656, 96622077945235750746259341397992234681113152, 3738663934452148315996562429573849015540177184, 148429945836675100345171498747820603623182345600, 6042377097623220759346549966140247567868980234272, 252061040983714232019559773875123523773810736105024, 10768589760183896509375295268861751415742928400488992, 470893819541548704548968763055599247403420065154200960, 21065191857030037165193106976347136127670896475579437856, 963527087113986799408032450242136313048365359832654457408, 45040811404213614013050328401619528891341165342131273329440, 2150746205803501971730696730800936963797862359302790884939136, 104862052630923660354789545443126114144159936191776894059032096, 5218040066508791466173321064085570087251331202995606268828665408] ------------------------ This took , 1952.620, second