Question: Let $A(n)$ be a finite square $n \times n$ matrix with entries $a_{ij}=1$ if $i+j$ is a prime number; otherwise equals to $0$. I write $|A_n|$ to count the number of $1$'s in $A(n)$ and set $$f_{n}=2|A_{n-1}|-|A_{n-2}|-|A_n|$$ Suppose that $f_n=0$ and $n$ is not prime is it true that $n\in$ A138666.
The sequence of integers, $|A_n|$, can be found here. In general I have that $$f_n=-2,0 \text{ or } 2$$