Answer:
-15202
Rule for the sequence:
Assume the sequence thus far is of length $n$. Create a mask vector of length $n$ with its terms decreasing from $n$ to 1 in absolute value. The sign of a term in the mask vector is positive iff that term appears in the original sequence. The next term is the dot product of the mask vector and the sequence. The sequence terminates once a negative number is reached (although this is a bit arbitrary, you could of course still continue it).
Example:
Assume the sequence so far is [1, 2, 4, 5, 11, 22]
. The mask vector is [-6, 5, 4, -3, 2, 1]
since 1, 2, 4 and 5 appear in the sequence, but 3 and 6 do not. The next term is $1*-6 + 2*5 + 4*4 + 5*-3 + 11*2 + 22*1 = 49$.
For the bonus question I assume you want a seed that
Produces an infinite sequence, i.e., does not produce any negative terms
EDIT: (The align environment seems to not work properly with spoilers, so a part of this is without spoiler, but I doubt that a quick glance at the formulas will give anything away if you do not want to be spoilered)
For the bonus the seed:
(1,4)
produces an infinite, positive sequence. Here's a proof: Start by computing the first few terms: [1,4,2,7,3,34,43,121,294,717,1639]
. From here on we are going to consider a slightly different sequence rule: We apply a similar procedure, but the sign in the mask vector will only be positive for 1, 2, 3 and 4. As all appear in the sequence, this modified sequence will be smaller than the original sequence. If we can show that the modified sequence is still always positive, then the original sequence will also be.
We prove this by induction. Let the sequence be $[a_1, a_2,\dots,a_n]$. IH1: $a_n+2a_{n-1}\geq \sum_{i=2}^{n-1}(i+1)a_{n-i}$, and IH2: $a_n\geq 2a_{n-1}$. For the base cases $n=8,9,10,11$ this holds.
IS1: Let the sequence be $[a_1, a_2,\dots,a_n,a_{n+1}]$ with $n>11$. We need to show that $a_{n+1}+2a_{n}\geq \sum_{i=1}^{n-1}(i+2)a_{n-i}$
$\begin{align}
&a_{n+1}+2a_{n}-\sum_{i=1}^{n-1}(i+1)a_{n-i} \\
&=(a_{n}+2a_{n-1}+3a_{n-2}+4a_{n-3}-\sum_{i=4}^{n-1}(i+1)a_{n-i})+2a_{n}-\sum_{i=1}^{n-1}(i+1)a_{n-i} \\
&=3a_{n}-2\sum_{i=4}^{n-1}(i+1)a_{n-i} \\
&\geq^{(IH2)} 2a_{n}+2a_{n-1}-2\sum_{i=4}^{n-1}ia_{n-1} \\
&\geq^{(IH1)} 2a_{n-2}+2a_{n-3} \geq 0
\end{align}$
IS1: Let the sequence be $[a_1, a_2,\dots,a_n,a_{n+1}]$ with $n>11$. We need to show that $a_{n+1} \geq 2a_{n}$
$\begin{align}
& a_{n+1} - 2a_{n}\\
& = (a_{n}+2a_{n-1}+3a_{n-2}+4a_{n-3}-\sum_{i=4}^{n-1}(i+1)a_{n-1})-2a_{n}\\
& = -a_{n}+2a_{n-1}+3a_{n-2}+4a_{n-3}-\sum_{i=4}^{n-1}(i+1)a_{n-1}\\
& = -(a_{n-1}+2a_{n-2}+3a_{n-3}+4a_{n-4}-\sum_{i=5}^{n-1}ia_{n-1})+ \\
& \phantom{ = } +2a_{n-1}+3a_{n-2}+4a_{n-3}-\sum_{i=4}^{n-1}(i+1)a_{n-1}\\
& = a_{n-1}+a_{n-2}+a_{n-3}-9a_{n-4}-\sum_{i=5}^{n-1}a_{n-1}+ \\
& \geq^{(IH2)} 3a_{n-2}+a_{n-3}-9a_{n-4}-\sum_{i=5}^{n-1}a_{n-1} \\
& \geq^{(IH2)} 7a_{n-3}-9a_{n-4}-\sum_{i=5}^{n-1}a_{n-1} \\
& \geq^{(IH2)} a_{n-3}+3a_{n-4}-\sum_{i=5}^{n-1}a_{n-1} \\
& \geq^{(IH1)} a_{n-4} \geq 0
\end{align}$
This completes the proof.
This is the only seed that produces such a sequence (besides (0,0)
if you want to count that). If neither $1$ nor $2$ is in the seed, we get a negative result immediately. For seeds $(1,0),(0,1),(2,0),(0,2),(1,1), (1,2), (2,1), (2,2)$ we can compute by hand that these produce a negative number eventually. For some $m>2$ when the seed is $(m,1)$ we get $1-m$ next, which is negative. For seeds of form $(2,m)$ we get $4-m$ next. For $m>4$ this is negative. For $(2,3)$ and $(2,4)$ we can check by hand again. For seeds of form $(m,2)$, we get $2m-2$ next. For $(3,2)$ we can check by hand that this goes negative. If $m>3$, then $3$ is not in the sequence yet, so the next term is $-(2m-2)+2*2-3m$ which is negative. This leaves only seeds of form $(1,m)$. Here, the next term is $m-2$. If $m>4$, neither 2 nor 3 are in the sequence and thus the next term is $(m-2)-2m-3$ which is negative. This leaves only $(1,3)$, which we can check by hand again, and $(1,4)$, which is infinitely positive as shown above.