Google interview question

Prime numbers variations, developing through levels