finish triangular number using arrayList in ArrayList