I'm trying to write a pda pushdown automata that accept a^2n b^n, n>0 but I'm not sure if the last part is correct
(p0, a, z0) = (p0, az0)
(p0, a, a) = (p0, aa)
(p0, b, a) = (p1, λ)
(p1, λ, b) = (p2, λ) <=
(p2, 0, b) = (p1, λ) <=
(p2, λ, z0) = (p3, λ) <=
As far as your answer is concerned, in your first two steps you are pushing a's in only one step. With the current design the machine would accept aaabb which is not in the form a^2nb^n. So it's better to divide it in two states separately. According to me the right answer might be something like: