Solutions to new problems

21 and 25 are both awful slow. 267 is a pretty neat problem.