Somebody incorrectly remembered Fermat's little theorem as saying that the congruence $a^{n+1} \equiv a \; \pmod{n}$ holds for all $a$ if $n$ is prime. Describe the set of integers $n$ for which this  property is in fact true.
1. **Lemma**: The set of integers \( n \) for which the property \( a^{n+1} \equiv a \pmod{n} \) holds for all \( a \) is the set of those squarefree \( n \) with the following property: if the prime \( p \) divides \( n \), then so does \( p-1 \).

2. **Proof of Lemma**:
    - Suppose \( p \) is a prime. If \( p^2 \mid n \), then \( p^2 \mid a^{n+1} - a \) for all \( a \). However, \( p^2 \nmid p^{n+1} - p \), so \( p^2 \nmid n \). This implies \( n \) must be squarefree.
    - If \( p \mid n \), we take a primitive root \( a \mod p \). By Fermat's Little Theorem, \( a^{p-1} \equiv 1 \pmod{p} \). Since \( a \) is a primitive root, the order of \( a \) modulo \( p \) is \( p-1 \). Therefore, \( a^n \equiv 1 \pmod{p} \) implies \( p-1 \mid n \) by the order-lemma.
    - Conversely, if \( n \) is squarefree and \( p \mid n \) implies \( p-1 \mid n \), then for any \( a \), \( a^{n+1} = a^{(p-1)q+1} \equiv a \pmod{p} \) (even if \( p \mid a \)).

3. **Claim**: All such numbers \( n \) are \( 1, 2, 6, 42, 1806 \).

4. **Proof of Claim**:
    - Testing these numbers to work using the lemma is straightforward. We need to show there are no other numbers with this property.
    - Assume there are more such numbers and let \( n = p_1 p_2 \cdots p_k \) with \( p_1 < p_2 < \cdots < p_k \) be the smallest exception. Then the number \( n' = p_1 p_2 \cdots p_{k-1} \) still has the property by the lemma (all requirements are fulfilled again) and is in \( M \).
    - Additionally, \( p_k - 1 \mid n' \), leaving us to check that all numbers \( d+1 \) with \( d \mid 1806 = 2 \cdot 3 \cdot 7 \cdot 43 \) and \( d \not\in M \) are not prime.

The final answer is \( \boxed{ \{1, 2, 6, 42, 1806\} } \).