0%

Problem 734


Problem 734


A bit of prime

The logical-OR of two bits is 0 if both bits are 0, otherwise it is 1.
The bitwise-OR of two positive integers performs a logical OR operation on each pair of corresponding bits in the binary expansion of its inputs.

For example, the bitwise-OR of 10 and 6 is 14 because 10=10102, 6=01102 and 14=11102.

Let T(n,k) be the number of k-tuples (x1,x2,,xk) such that

  • every xi is a prime n
  • the bitwise-OR of the tuple is a prime n

For example, T(5,2)=5. The five 2-tuples are (2,2), (2,3), (3,2), (3,3) and (5,5).

You are given T(100,3)=3355 and T(1000,10)2071632(mod1 000 000 007).

Find T(106,999983). Give your answer modulo 1 000 000 007.


质数与位运算

在数的二进制表示下,每一位数字称为一个比特。两个比特之间的逻辑或定义如下:若这两个比特均为0,则结果为0,否则结果为1
两个正整数的按位或定义如下:将这两个正整数表示成二进制,并将对应位置的比特进行逻辑或运算。

例如,106的按位或结果为14,这是因为10=101026=01102,而14=11102

T(n,k)为满足以下条件的k-元组(x1,x2,,xk)的数目:

  • 每个xi均为小于等于n的质数;
  • 元组中所有数按位或的结果是一个小于等于n的质数。

例如,T(5,2)=5,这五个2-元组分别是(2,2)(2,3)(3,2)(3,3)(5,5)

已知T(100,3)=3355T(1000,10)2071632(mod1 000 000 007)

T(106,999983),并将你的答案对1 000 000 007取余。


0 comments
Anonymous
Markdown is supported

Be the first person to leave a comment!