945. XOR-Equation C

We use xy for the bitwise XOR of x and y.

Define the XOR-product of x and y, denoted by xy, similar to a long multiplication in base 2, except that the intermediate results are XORed instead of the usual integer addition.

For example, 73=9, or in base 2, 1112112=10012:

11111121111112111111211111291110012

We consider the equation:

(aa)(2ab)(bb)=cc

For example, (a,b,c)=(1,2,1) is a solution to this equation, and so is (1,8,13).

Let F(N) be the number of solutions to this equation satisfying 0abN. You are given F(10)=21.

Find F(107).

945. 异或方程 C

我们记 xyxy 按位异或的结果。

我们定义 xy异或乘积 xy 如下:在列竖式进行二进制乘法时,其他步骤不变,只在最后得出结果时,将算出的每一列中的数字进行异或,而非原来的二进制加法。

例如,73=9。或将此等式表示为二进制为 1112112=10012。其计算过程如下:

11111121111112111111211111291110012

考虑如下方程:

(aa)(2ab)(bb)=cc

可以发现,(a,b,c)=(1,2,1),(1,8,13) 都是这个方程的一组解。

F(N) 为该方程满足 0abN 的解的数量,已知 F(10)=21

F(107)


这个链接 回到源站。

这个链接 回到详细版题目目录。