Application of two-order difference to gap statistic