headtail function

Print head and tail elements of a vector