Does the following hold for arbitrary positive integers $a$ and $n$: if $a^n-1$ is divisible by $n$ then so is $1+a+a^2+\cdots+a^{n-1}$? Let $a$ and $n$ be positive integers. Thanks to the equality
$$a^n-1=(a-1)(1+a+a^2+\cdots+a^{n-1}),$$
all divisors of $1+a+a^2+\cdots+a^{n-1}$ divide also $a^n-1$. The converse does not hold except for a very special case, but maybe always when the number $n$ happens to be a divisor of $a^n-1$ this particular divisor of it will divide also $1+a+a^2+\cdots+a^{n-1}$.

Let $f(x)=x^n-1\in\Bbb Z_d[x]$, where $d\mid n$.
The claim $$d\mid a^n-1\Rightarrow d\mid a^{n-1}+\ldots+1$$ is the same as saying that $f(a)=0\Rightarrow (x-a)^2\mid f(x)$. This can be shown by the following derivative-multiplicity test:

Let $f(x)\in R[x]$ be a polynomial in any polynomial ring over any commutative ring $R$. Then if $f(a)=f'(a)=0$ we have $(x-a)^2\mid f(x)$.


Proof: Suppose that $f(a)=0$, then $f(x)=(x-a)g(x)$. Taking the formal derivative we get $$f'(x)=g(x)+(x-a)h(x)$$ If $f'(a)=0$, we get that $g(a)=0$, and so $(x-a)\mid g(x)$, in other words $$(x-a)^2\mid f(x)$$

The derivative is $f'(x)\equiv_d nx^{n-1}\equiv_d 0$, so trivially $f'(a)\equiv_d 0$. Therefore $$(x-a)\mid\frac{x^n-1}{x-1}=x^{n-1}+\ldots+x+1$$ and so $$a^{n-1}+\ldots+a+1\equiv_d 0$$ which holds for any $d\mid n$.
