Function to generate a permutation of integers from 1 to N such that the absolute difference of all the two consecutive integers give K distinct integers
< ? php function printPermutation ( $ N , $ K ) {