CREATE TABLE table_21831229_3 (written_by VARCHAR, no_in_series VARCHAR)

Who wrote episode 31 in the series?
SELECT written_by FROM table_21831229_3 WHERE no_in_series = 31
SELECT "written_by" FROM "table_21831229_3" WHERE "no_in_series" = 31