a is a positive integer. If we express a in base 3, then its digit sum is 3. If we express a in base 4, then its digit sum is 2. How many possible a s are there?
For clarification, if we express 2018 in base 3, we will get 2 2 0 2 2 0 2 3 , then its digit sum is 10.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Remembering that if x has digit sum y in base b then x ≡ y m o d b − 1 . Thus, a ≡ 1 m o d 2 , a ≡ 2 m o d 3 . By CRT, these are equivalent to a ≡ − 1 m o d 6 .
Now, as a has digit sum 3 in base 3, it either has a 1 and a 2 in its digit expansion, or three 1's. In the latter case we would have that a = 3 x + 3 y + 3 z ≡ − 1 m o d 6 ( x = y = z ). It is a trivial computation to check that a solution to this congruence would have y = z = 0 which is a contradiction. So it must be that a = 3 x + 2 × 3 y ≡ − 1 m o d 6 . Again, it is a trivial computation to find that solutions only occur when y = 0 . So a = 3 x + 2 .
On the other hand a has digit sum 2 base 4 so it has either two 1's in its expansion or just a 2. In the latter case we would have a = 2 × 4 x ≡ − 1 m o d 6 . This congruence has no solutions. So it must be that a = 4 x + 4 y ≡ − 1 m o d 6 . A solution is only possible if y = 0 , x = 0 . So a = 4 x + 1 .
We now have to solve the diophantine equation 3 y + 2 = 4 x + 1 Rewrite as 3 y = 2 2 x − 1 ⟹ 3 y = ( 2 x − 1 ) ( 2 x + 1 ) ⟹ 2 x − 1 = 3 a , 2 x + 1 = 3 b ⟹ 2 x + 1 = 3 a + 3 b ⟹ that either a or b has to be zero (if both are non-zero then LHS is divisible by 3, which is a contradiction). Check both cases to obtain the only solution, x = y = 1 which means a = 5 .
To see why the congruences I studied behave like I mention notice that 3 x ≡ 3 m o d 6 and 4 x ≡ 4 m o d 6 for x > 0 . And 3 0 ≡ 4 0 ≡ 1 m o d 6 .
Sorry for the picture being like this...could not make it straight :(
Problem Loading...
Note Loading...
Set Loading...
If the digit sum of n in base 3 is 3 then
n = 3 a + 3 b + 3 c a , b , c ∈ N
Where at most 2 of a , b , c are equal. In a similar way
n = 4 d + 4 e d , e ∈ N
Hence
3 a + 3 b + 3 c = 4 d + 4 e
The L H S is always odd, so w.l.o.g. e = 0 . Since the R H S is always 2 m o d 3 , we need to have b = c = 0
3 a + 1 = 4 d
By Mihăilescu's theorem, the only solution is a = d = 1 .
This gives n = 5 = 1 2 3 = 1 1 4 as the only solution