A number $n$ is said to be nice if it exists an integer $r>0$ such that the expression of $n$ in base $r$ has all its digits equal. For example, 62 and 15 are $\emph{nice}$ because 62 is 222 in base 5, and 15 is 33 in base 4. Show that 1993 is not nice, but 1994 is.
Problem
Source: Spanish Communities
Tags: number theory unsolved, number theory
08.05.2006 19:40
n is nice if and only if $n=\frac{a(r^k-1)}{r-1},a<r$ Therefore n is nice if r>n (k=1,a=n). n is nice for r=n-1 (k=2,a=1). If condition is $0<r\le n-2$, then if n=ab,a<b-1 n is nice (r=b-1,k=2). For example 1994=2*997 is nice a=2, r=998. If n s prime it is nice only if n is general mersene prime: $n=\frac{r^p-1}{r-1}, p$ p is odd prime. (Mersene primes for r=2). It is easy cheked, that 1993 is not generalised Mersene prime, therefore it is not nice.
08.05.2006 19:47
A number is nice if it can be writen as $q\frac{r^m-1}{r-1}$ for some $q\in \{0..9\}$ and r integer,$q\le r$. Since 1993 is prime we would have that $q=1$ or $q=1993$ and it is easy too see that neither of these cases works. For 1994 $q$ can be equal to $1,2,997,1994$ then check each of these cases.
10.08.2009 02:33
Where it is written $ r>0$, it should be written $ 0<r<n-1$.