There are 9 such numbers, so the average is their midpoint, which is 31 .
The smallest positive integer to have four digits in base 3 is 3^3 =27, and the largest is 3^4 −1=80.
Thus, the integers which have four base 3 digits are 27,28,…,80.
The smallest positive integer to have two digits in base 6 is 6^1 =6, and the largest is 6^2−1=35.
Thus, the integers which have two base 6 digits are 6,7,…,35.
Therefore, the positive integers which have four base 3 digits and also have two base 6 digits are precisely the integers from 27 to 35.
There are 35−27+1=9 integers in this range, so their average is 9
27+28+⋯+35
= 9⋅31/9
= 31 .
Question
what is the average of all positive integers that have four digits when written in base $3$, but two digits when written in base $6$? write your answer in base $10$.