# Finding the Number of Positive Integers less than a given variable with no even digits in base representation

Fix $x\ge2$ an even integer. Find the number of integers less than $x^2$ which are divisible by $x-1$ and do not contain any even digits in their base $x$ representation. (natural generalization of $x$)

Looks at paper and stares at "fix $x\ge2$", and wonders "then doesn't that mean it could be any number that approaches $+\infty$?"

Are there any ways to approach this? I tried to plug in values for $x$ and figure out a pattern but I really couldn't find any connection...

P.S. I am not really sure which tag should I label this question, since I couldn't find number base representation.

• Hint: In base $x$, saying that a number is less than $x^2$ just means that it has two digits. – lulu Nov 10 '16 at 1:46
• @lulu Couldn't $x$ be $1,000$ though? Positive integers under $1,000,000$ are still two digits? Am I missing something here...? Thanks for the quick and prompt reply by the way :P – Hiro Nov 10 '16 at 1:51
• $x$ could be much larger than $1000$, but in base $x$, we always write $x^2$ as $100$. Not entirely sure what you mean by "even digits" if $x$ is large but I would guess you go $0,2,4,6,8,T,T+2,\cdots$. – lulu Nov 10 '16 at 1:52

The positive integers less than $x^2$ which are divisible by $x-1$ are $k(x-1)$ for $k=1,...,x+1$. If $1 \leq k < x$, then $k(x-1)=(k-1)x+x-k$ so $(k-1;x-k)_x$ will be the representation of $k(x-1)$ in base $x$. You are looking for $k$ even in order to $k-1$ be odd. But then $x-k$ would be even, absurd (recall that $x$ is assumed to be even).
Finally, if $k=x$, then $k(x-1)=x(x-1)$ does not have a even digit in its representation $(x-1)_x$ in base $x$ and if $k=x+1$ you have $k(x-1)=x(x-1)+(x-1)$ which also does not have an even digit in its representation $(x-1;x-1)_x$ in base $x$. Hence, there are a total of $2$ such numbers.
• If $x=10$, aren't $9$ and $99$ the only candidates? – lulu Nov 10 '16 at 1:57
• What happens if I said the numbers have to be less than $x^3$ rather than $x^2$, would it be 3 numbers? And how would you prove that algebraically? – Hiro Nov 10 '16 at 2:04
• @Hiro In that case the numbers to consider are $k(x-1)$, $k=1,..., x^2+x+1$. – mysatellite Nov 10 '16 at 2:22