Let $S$ be the set of natural numbers that cannot be written as the sum of three squares. Legendre's three-square theorem states that $S$ consists of precisely the integers of the form $4^a(8b+7)$ where $a$ and $b$ are nonnegative integers. Find the smallest $n\in\mathbb N$ such that $n$ and $n+1$ are both in $S$.
1. According to Legendre's three-square theorem, the set \( S \) consists of natural numbers that can be written in the form \( 4^a(8b+7) \) where \( a \) and \( b \) are nonnegative integers.
2. We need to find the smallest \( n \in \mathbb{N} \) such that both \( n \) and \( n+1 \) are in \( S \).
3. Since \( n \) and \( n+1 \) are consecutive integers, one of them must be even and the other must be odd.
4. If \( n \) is even, then \( n+1 \) is odd. Conversely, if \( n \) is odd, then \( n+1 \) is even.
5. Consider the case where \( n+1 \) is odd. For \( n+1 \) to be in \( S \), it must be of the form \( 4^a(8b+7) \). Since \( n+1 \) is odd, \( a \) must be 0 (because \( 4^a \) would make it even for \( a \geq 1 \)).
6. Therefore, \( n+1 = 8b + 7 \). This implies \( n = 8b + 6 \).
7. However, \( n \equiv 6 \pmod{8} \) is not of the form \( 4^a(8b+7) \) for any nonnegative integers \( a \) and \( b \). Thus, \( n+1 \) cannot be odd.
8. Now consider the case where \( n+1 \) is even. For \( n+1 \) to be in \( S \), it must be of the form \( 4^a(8b+7) \) with \( a \geq 1 \) (since \( n+1 \) is even).
9. Let \( a = 2 \) and \( b = 0 \). Then \( n+1 = 4^2(8 \cdot 0 + 7) = 16 \cdot 7 = 112 \).
10. Therefore, \( n = 112 - 1 = 111 \).
11. We need to check if \( 111 \) is also in \( S \). For \( 111 \) to be in \( S \), it must be of the form \( 4^a(8b+7) \).
12. Since \( 111 \) is odd, \( a \) must be 0. Thus, \( 111 = 8b + 7 \).
13. Solving for \( b \), we get \( 111 - 7 = 104 \) and \( 104 = 8b \), so \( b = 13 \).
14. Therefore, \( 111 = 8 \cdot 13 + 7 \), which is of the form \( 4^a(8b+7) \) with \( a = 0 \) and \( b = 13 \).

The final answer is \( \boxed{111} \).