Problem 242
Odd Triplets
Given the set {1,2,…,n}, we define f(n,k) as the number of its k-element subsets with an odd sum of elements. For example, f(5,3) = 4, since the set {1,2,3,4,5} has four 3-element subsets having an odd sum of elements, i.e.: {1,2,4}, {1,3,5}, {2,3,4} and {2,4,5}.
When all three values n, k and f(n,k) are odd, we say that they make
an odd-triplet [n,k,f(n,k)].
There are exactly five odd-triplets with n ≤ 10, namely:
[1,1,f(1,1) = 1], [5,1,f(5,1) = 3], [5,5,f(5,5) = 1], [9,1,f(9,1) = 5] and [9,9,f(9,9) = 1].
How many odd-triplets are there with n ≤ 1012 ?
奇数三元组
取集合{1,2,…,n}的所有k元子集,记其中元素和为奇数的子集数目为f(n,k)。例如,f(5,3) = 4,因为集合{1,2,3,4,5}有4个3元子集,其元素和为奇数,分别是{1,2,4}、{1,3,5}、{2,3,4}和{2,4,5}。
当n、k和f(n,k)均为奇数时,我们称它们组成了
奇数三元组 [n,k,f(n,k)]。
当n ≤ 10时,恰好有5个奇数三元组,分别是:
[1,1,f(1,1) = 1]、[5,1,f(5,1) = 3]、[5,5,f(5,5) = 1]、[9,1,f(9,1) = 5]和[9,9,f(9,9) = 1]。
当n ≤ 1012时,有多少个奇数三元组?