It's says p-1 is factor to the equation, so that means when
p=1, the remeinder of the equation is zero. Mening:
p4 + p2 + p - k = 0
plug p=1 into the equation and find k
1^4 + 1^2 + 1 - k = 0
1 + 1 + 1 - k = 0
k = 3
They're just multiplying those numbers by 3 then just multiply 162 by 3 to get one of the next numbers in the sequence then multiply those awnser you get by 3