Sums of two squares by mitchs

#!ruby -pl
r=[[0,1]]
eval(gets).map{|q,e|r*=~e%2|a=3&~b=q-1|1
eval"e+=a=1while-(i=60#{';a=a*a*e**q[i-=1]%q'*58})*a%q!=1
a=b%b=a while b*b>q"*a+%w{;r= |(a=-a; )}*'r.map{|c,d|[(b*c-d*a).abs,b*d+a*c].sort}'*e/=2-a/2}
$_=r.sort.map{|x|x*'^2 + '+'^2'}*' = '

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page