#P8842. [传智杯 #4 初赛] 小卡与质数 2
[传智杯 #4 初赛] 小卡与质数 2
Background
Xiaoka has become obsessed with prime numbers!
Problem Description
Xiaoka has recently become obsessed with prime numbers, so he wants to turn any number into a prime number!
Xiaoka has queries. Each time, you are given a number . You need to ask: how many non-negative integers less than make a prime number, where denotes bitwise XOR.
Input Format
The first line contains a positive integer , meaning there are queries.
The next lines each contain a positive integer .
Output Format
For each query, output one line with one integer, representing the answer.
9
5
6
7
8
9
10
100
1000
10000
2
4
4
2
2
4
22
163
1132
Hint
Translated by ChatGPT 5