(define survives? (lambda (position people) (or (= people 2) (and (not (= position 3)) (survives? (remainder (- (+ position people) 3) people) (- people 1)))))) (define first-surviving-after (lambda (position people) (let ((next (+ position 1))) (if (survives? next people) next (first-surviving-after next people))))) (define good-spots (lambda (people) (let ((first-spot (first-surviving-after 0 people))) (let ((second-spot (first-surviving-after first-spot people))) (list first-spot second-spot)))))