Basic encoding with math formula As part of my practice coding, I was given the following problem. 

Let's say you have the binary string 011100011. One way to encode the
  string would be to add each digit to the sum of its adjacent digits.
  Resulting in the sting 123210122. Given the ENCRYPTED string 22111, what would the original string be using the same decryption pattern.

I would ideally like to solve the problem algebraically, but am a very novice mathematician.
Where Q is the encrypted string, P is the decrypted string then and i is the digit's position within the string:
$$Q^i = P^{i-1}+P^{i}+P^{i+1}$$
Now, I could solve this by using code, but surely there's an elegant mathematical solution to the decryption of the encoded strings. My problem is, I'm not even sure where I should be looking. Can anyone point me in the right direction?
EDIT: Having clarified this with my instructor, it turns out I'll need to provide to possible solutions to the problem. One assuming the first digit of the original string starts with 0, the other assuming it starts with a 1. To add also, just in case it wasn't clear before, the string can only contains ones and zeroes à la binary.
 A: You could write the encryption as a matrix product.  The matrix has ones on the main diagonal, and one diagonal either side.  To decrypt it, multiply by the inverse of the matrix.  
$$\left[\begin{array}{ccccc}1&1&0&0&0\\1&1&1&0&0\\0&1&1&1&0\\0&0&1&1&1\\0&0&0&1&1\end{array}\right]\left[\begin{array}{c}a\\b\\c\\d\\e\end{array}\right]=\left[\begin{array}{c}2\\2\\1\\1\\1\end{array}\right]$$
EDIT:  This matrix is not invertible, so I think there is no solution.  You could add any multiple of $[1,-1,0,1,-1]$ to one solution, to get another solution.
A: An encrypted string has a solution iff:

*

*it is not length $2\mod3$

*it is length $5\mod3$ and does not not start:end either $122:221$ or $111:111$
A solution can be found by examining the first two numbers in the encryption, say $AB$. The value of the $3^{rd}$ digit in the originator is then $B-A$.
As long as we can orientate the first two digits, we can proceed in the obvious fashion.
For example using $123210122$ from the question, we get:

*

*$xx1xxxxxx$


*$011xxxxxx$


*$0111xxxxx$
$\vdots$


*$011100011$
If the start is hindered, we can start from the end.
In the cases $122$ and $111$, we get $xx1$ and $xx0$ respectively, but are unable to resolve whether we have $101$ or $011$ (and $100$ or $010$) and so progress is halted. A string length $2$ is ambiguous for $01$ and $10$, both  of which have encryptions $11$.
I note that if $b_i$ is a binary string, then $En(b_i)\lt En(b_{i+1})$, with $En(b)$ being the encryption of $b$, except at $b_i=0111\dots111$.
