1064
For a positive integer k, denote the maximum nonnegative integer i such that 2i divides k by v2(k). Note that v2(kl)=v2(k)+v2(l) holds for any positive integers k and l, and that v2(2k)=v2(k)−1 holds for any positive even number k.
Lemma 1. Let s and t be positive integers.
* If v2(s)=v2(t), we have v2(s+t)=min{v2(s),v2(t)}.
* If v2(s)=v2(t), we have v2(s+t)>v2(s).
Proof. We can write s=2v2(s)x, t=2v2(t)y for some odd integers x,y.
In the case of v2(s)<v2(t), we have s+t=2v2(s)(x+2v2(t)−v2(s)y). Since 2v2(t)−v2(s)y is even, x+2v2(t)−v2(s)y is odd. Thus v2(s+t)=v2(s)=min{v2(s),v2(t)} holds.
In the case of v2(s)>v2(t) the same argument shows that v2(s+t)=min{v2(s),v2(t)}.
In the case of v2(s)=v2(t), we have s+t=2v2(s)x+2v2(s)y=2v2(s)(x+y). Since x+y is even, we have v2(s+t)>v2(s). ■
Lemma 2. If s,t∈N satisfy v2(s)=v2(t)≥1, we have:
∙v2(t+2s)=v2(2s)=v2(s)−1,
∙v2(s+2t)=v2(2t)=v2(s)−1.
Proof. Since v2(2s)=v2(s)−1<v2(s)=v2(t), we have v2(t+2s)=min{v2(t),v2(2s)}=v2(2s) by Lemma 1. Thus we have v2(t+2s)=v2(2s)=v2(s)−1. Similarly v2(s+2t)=v2(2t)=v2(t)−1=v2(s)−1 holds. ■
We will show that, if a1,a2,… and b1,b2,… satisfy the condition of the problem, v2(a1)=v2(b1) holds.
Assume v2(a1)=v2(b1). If v2(a1)=v2(b1)=0, a2 cannot be an integer. If v2(a1)=v2(b1)=k≥1, Lemma 2 shows inductively that v2(an)=v2(bn)=k−n+1 for n≤k+1. However, when n=k+1 we have v2(an)=v2(bn)=0, then an+1 cannot be an integer. This is a contradiction and we conclude that v2(a1)=v2(b1).
Next we will show that, for any integers 1≤s,t≤40 with v2(s)=v2(t), there exists sequences a1,a2,… and b1,b2,… such that a1=s and b1=t.
Lemma 3. If s,t∈N satisfy v2(s)=v2(t), at least one of the following statements hold:
* s is even and v2(t+2s)=v2(2s) holds.
* t is even and v2(s+2t)=v2(2t) holds.
Proof. We will show that if v2(s)>v2(t) the first condition holds. s is even because v2(s)≥1.
If v2(s)=v2(t)+1, we have v2(2s)=v2(s)−1=v2(t) and thus v2(t+2s)>v2(2s) by Lemma 1. If v2(s)≥v2(t)+2, we have v2(2s)=v2(s)−1>v2(t) and thus v2(t+2s)=min{v2(t),v2(2s)}=v2(t)<v2(2s) by Lemma 1.
Let a1=s,b1=t. Then for n=1,2,… we can proceed inductively as follows:
Since v2(an)=v2(bn), Lemma 3 shows that at least one of (x,y)=(2an,bn+2an), (an+2bn,2bn) is a pair such that v2(x)=v2(y). We set an+1=x,bn+1=y for such (x,y).
The resulting sequences a1,a2,… and b1,b2,… meet the condition of the problem. Therefore the answer is the number of pairs of integers (s,t) with 1≤s,t≤40 such that v2(s)=v2(t).
Note that v2(n)≤5 for 1≤n≤40 because 40<26. For k∈{0,1,…,5}, the number f(k) of integers 1≤n≤40 such that v2(n)=k is ⌊2k40⌋−⌊2k+140⌋. Thus we can calculate
f(0)=20,f(1)=10,f(2)=5,f(3)=3,f(4)=1,f(5)=1.
The number of pairs of integers (s,t) with 1≤s,t≤40 such that v2(s)=v2(t) is ∑k=05f(k)2=536. Therefore, the answer is 402−536=1064.