Given a nondecreasing sequence \(a\) with \(n\) integer \(a_1, a_2, ..., a_n\).
Please find the number of pairs of indexes \(i , j(i < j)\) that \(a_i + a_j\) is a power of \(2\) .
Given a nondecreasing sequence \(a\) with \(n\) integer \(a_1, a_2, ..., a_n\).
Please find the number of pairs of indexes \(i , j(i < j)\) that \(a_i + a_j\) is a power of \(2\) .
4
1 2 3 7
2
The correspond solutions to the sample is :
1 + 3 = 2^2
1 + 7 = 2^3