3. For how many positive integers $n$ less than 200 is $n^{n}$ a cube and $(n+1)^{n+1}$ a square?
SolUTION
For $n^{n}$ to be a cube, we require either that $n$ is a multiple of 3 or that $n$ is a cube (or both).
For $(n+1)^{n+1}$ to be a square, we require either that $(n+1)$ is even or that $(n+1)$ is a square (or both).

We can take one from each of these pairs of criteria, giving four cases, and count the total:
(a) $n$ is a multiple of 3 and $(n+1)$ is even:
This occurs exactly when $n$ is an odd multiple of $3(3,9,15, \ldots)$.
There are $\mathbf{3 3}$ such $n$ less than 200 .
(b) $n$ is a multiple of 3 and $(n+1)$ is a square:
Checking all the squares between 1 and 200 as possibilities for $(n+1)$ :
\begin{tabular}{ccc}
$n+1$ (square) & $n$ & is $n$ a multiple of $3 ?$ \\
\hline 4 & 3 & yes \\
9 & 8 & no \\
16 & 15 & yes \\
25 & 24 & yes \\
36 & 35 & no \\
49 & 48 & yes \\
64 & 63 & yes \\
81 & 80 & no \\
100 & 99 & yes \\
121 & 120 & yes \\
144 & 143 & no \\
169 & 168 & yes \\
196 & 195 & yes
\end{tabular}

So there are nine of these.
However, we have counted five of them before ( $n=3,15,63,99,195$ ), so there are $\mathbf{4}$ new possible values of $n$.
(c) $n$ is a cube and $(n+1)$ is even: for these we need $\mathrm{n}$ to be an odd cube:
$$
\begin{aligned}
n & =1,27,125 \\
(n+1) & =2,28,126
\end{aligned}
$$

There are three of these, but again we have counted one of them before $(n=27)$, so there are $\mathbf{2}$ possible new values of $n$.
(d) $n$ is a cube and $(n+1)$ is a square:
It is easiest to check the possible values of $(n+1)$ for the cube values of $n$ to see if any are square:
\begin{tabular}{ccc}
$n$ (cube) & $n+1$ & is $(n+1)$ a square? \\
\hline 1 & 2 & no \\
8 & 9 & yes \\
27 & 28 & no \\
64 & 65 & no \\
125 & 126 & no
\end{tabular}

So there is 1 more value of $n$.
Hence in total there are $33+4+2+1=\mathbf{4 0}$ values of $n$ such that $n^{n}$ is a cube and $(n+1)^{n+1}$ is a square.