Chef is stuck at the following problem. Help him solve it!
Chef has a sequence of integers A1,A2,…,AN. He should find the number of pairs (i,j) such that 1≤i<j≤N and the bitwise XOR of Ai and Aj can be written as a sum of two (not necessarily different) prime numbers with the same parity (both odd or both even).
This is a(n):
Details:
Chef is stuck at the following problem. Help him solve it!
Chef has a sequence of integers A1,A2,…,AN. He should find the number of pairs (i,j) such that 1≤i<j≤N and the bitwise XOR of Ai and Aj can be written as a sum of two (not necessarily different) prime numbers with the same parity (both odd or both even).