/prim { /n exch def /f true def 2 1 n 2 div {n exch mod 0 eq { /f false def } if } for f } def /next { /p exch 1 add def { p prim {exit} if /p p 1 add def } loop p } def /nth { /n exch def n 1 eq {2} {n 1 sub nth next} ifelse } def 1 1 99 { dup nth exch 1 add nth exch sub nth = } for