idx_pairs = np.where(np.diff(np.hstack(([False], a1 == 1, [False]))))[0
    ].reshape(-1, 2)
start_longest_seq = idx_pairs[np.diff(idx_pairs, axis=1).argmax(), 0]
find the start position of the longest sequence of 1's