a)
We prove by induction on n that an=s2(n) for all n≥1 where s2(n) is the sum of the digits of n in binary representation.
The base case n=1 is trivial. Now, we assume that an=s2(n) is proved for n=1,2,…,k, and prove it for n=k+1.
We shall prove the statement for k with some cases as follows.
• 2∣k+1, let k+1=x1x2...xm−1xm(2) with x1=1,xm=0.
It follows 2k+1=x1x2...xm−1(2), so
ak+1=a2k+1=s2(2k+1)=s2(k+1).
• 2∣k, let k+1=x1x2...xm−1xm(2) with x1=1,xm=1.
It follows 2k=x1x2...xm−1(2), so
ak+1=a2k+1=s2(2k)+1=s2(k+1).
Therefore in all cases, we always have ak+1=s2(k+1). So that an=s2(n) for all positive integers n. We distinguish two cases regarding the value of n.
Case 1. n<3, it is easy to see that n∈{1,2} satisfied.
Case 2. n≥3, we investigate three subcases
Subcase 1. if n=100...0(2) then choose k=3, so kn=1100...0(2), which is not satisfying an=akn.
Subcase 2. if n=111...1(2) then we will prove n in this case satisfied. Assume that n=2t−1, with k<n and k is odd, expand k=x1x2...xt(2). We have
kn=x1x2...xt00...0(2)−x1x2...xt0(2)=x1x2...xt−10y1y2...yt−11
with number x1x2...xt00...0(2) have t digits 0 after xt and yi=1+xi(mod2) for all i<t because
y1y2...yt−11(2)+x1x2...xt−11=100...0(2)(mod2) (t numbers 0).
Thus, s2(kn)=1+0+∑i=1t−1(xi+yi)=t for all k odd.
On the other hand, if k is even then s2(kn)=s2(2v2(k)k⋅n)=t.
Thus, s2(kn)=t for all k<n+1.
Subcase 3. n does not have the form of 2t or 2t−1. Let n=2p⋅q where q is odd and greater than 1, we have
* p>0, let n=x1x2…xm00…0(2) with p digits 0, so xm=1. Choose k=100…01 with k−1 digits 0, so
nk=2p(x1…xm0…0(2)+x1…xm(2))=2px1…xmx1…xm.
Therefore, s2(kn)=2s2(n), which is not satisfied.
* p=0, let n=x1x2…xkxk+1xk+2…xt, with x1=1=xk+1=1 and xk+2=⋯=xt=0 because t does not have the form of 2t−1.
Choose k=100…01(2) with t−2 digits 0. It follows that
kn=2t−1n+n=x1x2…xt00…0(2)+x1x2…xt(2)=x1x2…xk100…0x2x3…xt(2)
with x1x2…xk100…0x2x3…xt(2) have t−k+1 digits 0 from tth in the left to kth in the right and x1x2…xt00…0(2) have t−1 digits 0 at the end.
Thus, s2(kn)=s2(n)+x1+x2+⋯+xk>s2(n) since x1=1, which do not satisfied akn=an for all k≤n.
Hence, there are only n=2 and n=2t−1 satisfied.
b)
Choose m=2p, so am=1≤akm for all positive integers k.
□