Comparing Array

Hello,

can you plz help me.
i am checking two array.

var temItemNo_array:Array = Array(12,13,17,19,20);
var Item_array:Array = Array(12, 13, 14, 15, 16, 17);

when checked temItemNo && Item_array in this arrays 12,13 are same no.
but when 12 & 13 got continuous common no. that time want stop on 13 no and add on 13+1=14

Thanks
JaxNa