Problem 967
$B$-Trivisible Numbers
A positive integer $n$ is considered $B$-trivisible if the sum of all different prime factors of $n$ which are not larger than $B$ is divisible by $3$.
For example, $175 = 5^2 \cdot 7$ is $10$-trivisible because $5 + 7 = 12$ which is divisible by $3$. Similarly, $175$ is $4$-trivisible because all primes dividing $175$ are larger than $4$, and the empty summation $0$ is divisible by $3$.
On the other hand, $175$ is not $6$-trivisible because the sum of relevant primes is $5$ which is not divisible by $3$.
Let $F(N, B)$ be the number of $B$-trivisible integers not larger than $N$.
For example, $F(10, 4) = 5$, the $4$-trivisible numbers being $1,3,5,7,9$.
You are also given $F(10, 10) = 3$ and $F(100, 10) = 41$.
Find $F(10^{18}, 120)$.
$B$-三除数
如果正整数$n$所有不大于$B$的不同质因数之和能被$3$整除,则称$n$为$B$-三除数。
例如,$175 = 5^2 \cdot 7$是$10$-三除数,因为$5 + 7 = 12$能被$3$整除。类似地,$175$是$4$-三除数,因为所有能整除$175$的质数都大于$4$,而$0$能被$3$整除。
另一方面,$175$不是$6$-三除数,因为满足条件的质数之和为$5$,并不能被$3$整除。
设$F(N, B)$为不大于$N$的$B$-三除数的数目。
例如,$F(10, 4) = 5$,这些$4$-三除数分别是$1,3,5,7,9$。
还已知$F(10, 10) = 3$,$F(100, 10) = 41$。
求$F(10^{18}, 120)$。