Solving the functional equation $\sum f(n) = \sum [f(n)]^2$. On a recent assignment, I (wrongly) wrote off that 
$$\int_0^{2\pi}\sin(x)dx =0 \implies \int_0^{2\pi}\sin^3(x) dx = 0$$
Though the result is not wrong, the integral of $f(x)$ over an interval being $0$ does not force the integral of $[f(x)]^3$ over that same interval to be $0$.
I came up with a related functional equation I cannot find any non-trivial solutions for:

$$\sum_{n=1}^\infty f(n)=\sum_{n=1}^\infty [f(n)]^2$$

Additionally, I wonder what other non-constant functions satisfy

$$\sum_{n=1}^\infty f(n)=\sum_{n=1}^\infty [f(n)]^k$$

for other $k>2$.
Edit: I changed the exponent from $3$ to $2$ because I realized there are a large number of pretty easily-obtained solutions in the case where $k=3$.
 A: Let $g$ be any function such that $$\sum_{n=1}^\infty g(n) \text{ and } \sum_{n=1}^\infty [g(n)]^2$$ both converge. 
Let $$\sum_{n=1}^\infty g(n)=A \text{ and } \sum_{n=1}^\infty [g(n)]^2=B$$ then 
$f(x)=\frac{A}{B}g(x)$ satisfies the required equation.
Similarly, you can obtain solutions for other powers.
A: Define
$$f(n,x)=\frac{10}{(n+x)^2}$$
Then
$$\sum_{n=1}^\infty f(n,1)=6.44934\text{ while }\sum_{n=1}^\infty f(n,1)^2=8.23232$$
However, for $x=2$ we have
$$\sum_{n=1}^\infty f(n,2)=3.94934\text{ while }\sum_{n=1}^\infty f(n,2)^2=1.98232$$
Since 
$$g(x)=\sum_{n=1}^\infty \left(f(n,x)-f(n,x)^2\right)$$
and
$$g(1)=-1.78298\text{ while }g(2)=1.96702$$
there exists $x_0\in (1,2)$ such that
$$g(x_0)=0\Rightarrow \sum_{n=1}^\infty f(n,x_0)=\sum_{n=1}^\infty f(n,x_0)^2$$
More generally, for $k\geq 2$, we have
$$\sum_{n=1}^\infty \frac{3}{n^2}=3\zeta(2)=\frac{\pi^2}{2}<9\leq 9\zeta (2k)\leq 3^k\zeta(2k)=3^k \sum_{n=1}^\infty \frac{1}{n^{2k}}=\sum_{n=1}^\infty \left(\frac{3}{n^{2}}\right)^k$$
Define
$$f(n,x)=\frac{3}{(n+x)^2}$$
and
$$g(x)=\sum_{n=1}^\infty\left(f(n,x)-f(n,x)^k\right)$$
We know from the above analysis
$$g(0)=\sum_{n=1}^\infty\left(f(n,0)-f(n,0)^k\right)=\sum_{n=1}^\infty\left(\frac{3}{n^2}-\left(\frac{3}{n^{2}}\right)^k\right)<0$$
However, we know that for large enough $x$, $g(x)>0$. This can be seen if we consider a single term of the infinite sum:
$$\frac{1}{(n+x)^2}-\frac{3^k}{(n+x)^{2k}}= \frac{-3^k n^2+(n+x)^{2 k}-2\ 3^k n x-3^k x^2}{(n+x)^{2 k+2}}$$
The numerator goes to infinity as $x$ increases as the coefficient in front of $x^{2k}$ and $n^{2k}$ is positive (and these are the largest powers of $x$ and $n$ respectively). Thus, for large enough $x$, 
$$\frac{1}{(n+x)^2}-\frac{3^k}{(n+x)^{2k}}>0$$
which implies $g(x)>0$. Thus, there exists $x_0$ such that
$$g(x_0)=0\Rightarrow \sum_{n=1}^\infty f(n,x_0)=\sum_{n=1}^\infty f(n,x_0)^k$$
