Let $n$ be the inverse of $2\pmod{17}$. That is, let $n$ be the integer $0\leq n < 17$ for which $2n \equiv 1 \pmod{17}$. What is $\left(2^n\right)^2 - 2 \pmod{17}$?

Express your answer as an integer from $0$ to $16$, inclusive.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Let $n$ be the inverse of $2\pmod{17}$. That is, let $n$ be the integer $0\leq n < 17$ for which $2n \equiv 1 \pmod{17}$. What is $\left(2^n\right)^2 - 2 \pmod{17}$?

Express your answer as an integer from $0$ to $16$, inclusive.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
Let $n$ be the inverse of $2\pmod{17}$. That is, let $n$ be the integer $0\leq n < 17$ for which $2n \equiv 1 \pmod{17}$. What is $\left(2^n\right)^2 - 2 \pmod{17}$?

Express your answer as an integer from $0$ to $16$, inclusive.
train