(* The following function performs one step of the 4-number game.*)

f[{a_,b_,c_,d_}]:={Abs[a-b],Abs[b-c],Abs[c-d],Abs[d-a]}

(* Example *)

f[{9,7,5,1}]

(* Example: We can use TableForm and NestList to show how the game evloves.*)

TableForm[NestList[f, {9,7,5,1}, 7]]

(*******************************************)

(* The following function, g, generalizes f to n-numbers *)

g[ls_]:=MapThread[Abs[#1-#2]&, {ls, RotateLeft[ls]}]

(* Example *)

g[{a1, a2, a3, a4, a5, a6, a7}]

(* Example *)

TableForm[NestList[g, {1,2,4,8,16,32,64}, 60]]