Solution:
Let sn be the sum of the absolute values of numbers in the nth row. For odd n, we have that an,1,…,an,n−1 alternate in sign as −,+,−,+,…,+, with the last term being an,n−1=1. For even n, we have that an,1,…,an,n−2 alternate in sign as −,+,−,+,…,+, and an,n−1=0. These facts can be proven by induction. Thus, sn=1−an,1+an,2−⋯+(−1)n−1an,n−1+1.
Applying the recursion, for n>0 this becomes
sn=1−(an−1,1−an−1,0)+(an−1,2−an−1,1)−⋯+(−1)n−1(an−1,n−1−an−1,n−2)+1
=2(1−an−1,1+an−1,2−⋯+(−1)n−2an−1,n−2+1)−1+(−1)n−1
In other words, if n is even then sn=2sn−1−2 and if n is odd then sn=2sn−1. This means that s2n=4s2n−2−2. Since 2018 is even, we can write s2018=4s2016−2=22018−22017−22015−⋯−2.
Applying the formula for the sum of a geometric series, we get
s2018=22018−4−122019−2=322018+2