The first, 40, terms of the sequence enumerating permutations of length n suc\ h that pi[i+2]-pi[i] is never 4 are or equivalently, such that pi[i+4]-pi[i] is never 2 are [1, 2, 6, 24, 102, 544, 3480, 25944, 220308, 2103280, 22267464, 258731736, 3272134452, 44730567808, 657118903128, 10322461311000, 172640373779220, 3062488841908432, 57428041336168488, 1134996967159452312, 23578970729098529364, 513649562721606586720, 11707696306745481688152, 278659373809358532000984, 6913254482346326278969428, 178472672513539944721144624, 4787091918527589331581205320, 133218232423238577803066798424, 3841256747999729575774795026228, 114621696869863289989638111958720, 3535462778557195348669757699383704, 112602037234219748433581049305868696, 3699395519170581012617058814997058132, 125253680563408568997302976350830463248, 4366569698246206370774711148480089406888, 156609318261518653524946795441774634639640, 5774036664647278639517932157386144259381460, 218676583726728825714366041014439281192115872, 8501176735585197320086009417079962899770294808, 339014958761616274028609971207648002296075746392] --------------------------------- This took, 2665.746, seconds.