Suggestion

The function \(f(n)\) is defined for positive integers \(n\) according to the rules \[f(1)=1,\qquad f(2n)=f(n),\qquad f(2n+1)=(f(n))^2-2.\] The value of \(f(1)+f(2)+f(3)+\cdots+f(100)\) is

  1. \(-86\),

  2. \(-31\),

  3. \(23\),

  4. \(58\).

Can we work out the first few values of the function?