I think the answer can be obtained by simply following the recursion law for 5 steps: Each term is the sum of the square of the previous one plus the value of the one two back.
Since k1 = 1 and k2 = 0 k3 = 12 + 0 = 1
similarly k4 = 12 + 0 = 1
and k5 = 12 + 1 = 2
and k6 = 22 + 1 = 5
finally k7 = 52 + 2 = 27