# Number Theory - Repunits

## Homework Statement

A base b repunit is an integer with base b expansion containing all 1's.

a) Determine which base b repunits are divisible by factors b-1

b) Determine which base b repunits are divisible by factors b+1

## Homework Equations

$$R_{n}=\frac{b^{n}-1}{b-1}$$

## The Attempt at a Solution

So a repunit of base 3 would be n=2 since we get 1. I don't get how to find any beyond this point though. I tried using other n numbers but I didn't get any others that come out to all 1's.

uart

## Homework Statement

A base b repunit is an integer with base b expansion containing all 1's.

a) Determine which base b repunits are divisible by factors b-1

b) Determine which base b repunits are divisible by factors b+1

## Homework Equations

$$R_{n}=\frac{b^{n}-1}{b-1}$$

## The Attempt at a Solution

So a repunit of base 3 would be n=2 since we get 1. I don't get how to find any beyond this point though. I tried using other n numbers but I didn't get any others that come out to all 1's.

So if the repunit is divisible by (b+1) then $b^{n}-1$ is divisible by $b^2-1$.

Similarly if the repunit is divisible by (b-1) then $b^{n}-1$ is divisible by $(b-1)^2$.

Try applying the concepts of the remainder theorem to each of the above.

We haven't covered the remainder theorem yet...

uart
We haven't covered the remainder theorem yet...

Ok, well imagine that you divided $b^n-1$ by $(b-1)(b+1)$. Then if "Q" was the quotient and "R" the remainder of this division we could write :

$$b^n-1 = (b-1) (b+1)\,Q+ \alpha b + \beta$$

Where $R(b) = \alpha b + \beta$ is the remainder.

Try substituting first b=1 and then b=-1 into the above equation and see what conditions are required to make R=0.

Last edited:
Well for b=1 then $$\alpha$$ will be positive so $$\beta$$ will have to be the negative of $$\alpha$$

The opposite is true for b=-1, $$\alpha$$ will be negative and $$\beta$$ is going to be the positive of that number...

I figured out that for a its if and only if the number of digits is a multiple of d, where d divides b-1.

For b, would it just be if and only if the alternating sum comes out to a multiple of d, where d divides b+1?

uart
Well for b=1 then $$\alpha$$ will be positive so $$\beta$$ will have to be the negative of $$\alpha$$
Yes that first part is correct, when b=1 we must have $\alpha + \beta = 0$ to get zero remainder.
The opposite is true for b=-1, $$\alpha$$ will be negative and $$\beta$$ is going to be the positive of that number...