ListPlot[Table[(((x-1)! + 1) mod (x)),{x,1,30}]]