Gaussian Prime by recursive

P=lambda p:all(p%d for d in range(2,p))
D=range(-23,24)
for a in D:print"".join(" [ ]"[P(a*a+b*b)if a*b else(abs(a+b)%4>2and P(abs(a+b)))::2]for b in D)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top