For what value of $n$ is $i + 2i^2 + 3i^3 + \cdots + ni^n = 48 + 49i$?

Note: $i^2 = -1$
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
For what value of $n$ is $i + 2i^2 + 3i^3 + \cdots + ni^n = 48 + 49i$?

Note: $i^2 = -1$
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
97
For what value of $n$ is $i + 2i^2 + 3i^3 + \cdots + ni^n = 48 + 49i$?

Note: $i^2 = -1$
train