Ruby, (削除) 258 (削除ここまで) (削除) 256 (削除ここまで) 249+8(削除) 249 (削除ここまで) 246+8 = (削除) 264 (削除ここまで) 257(削除) 257 (削除ここまで) 254 bytes
Uses the -rprime flag.
Geez, what a mess.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*eval("%d+%di"%(x/y).rect)};a=c.abs2.prime_division.mapflat_map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a;a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) (削除) 256 (削除ここまで) 249+8 = (削除) 264 (削除ここまで) 257 bytes
Uses the -rprime flag.
Geez, what a mess.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*eval("%d+%di"%(x/y).rect)};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) (削除) 256 (削除ここまで) (削除) 249 (削除ここまで) 246+8 = (削除) 264 (削除ここまで) (削除) 257 (削除ここまで) 254 bytes
Uses the -rprime flag.
Geez, what a mess.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*eval("%d+%di"%(x/y).rect)};a=c.abs2.prime_division.flat_map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)};a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) 256+8(削除) 256 (削除ここまで) 249+8 = 264(削除) 264 (削除ここまで) 257 bytes
Uses the -rprime flag.
Geez, what a mess. Tons of boilerplate went into calculating moduluses between Gaussian numbers.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*Complexy*eval(*"%d+%di"%(x/y).rect.map(&:to_i))};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) 256+8 = 264 bytes
Uses the -rprime flag.
Geez, what a mess. Tons of boilerplate went into calculating moduluses between Gaussian numbers.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*Complex(*(x/y).rect.map(&:to_i))};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) (削除) 256 (削除ここまで) 249+8 = (削除) 264 (削除ここまで) 257 bytes
Uses the -rprime flag.
Geez, what a mess.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*eval("%d+%di"%(x/y).rect)};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, 258(削除) 258 (削除ここまで) 256+8 = 264 bytes
Uses the -rprime flag.
Geez, what a mess. Tons of boilerplate went into calculating moduluses between Gaussian numbers.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*Complex(*(x/y).rect.map(&:to_i))};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..bd=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;a=b;a%b+1i;d,k=k,m[am[d,k]while k!=0;c/=a=m[c=d=m[c,a]==0d]==0?ad:ad.conj;aconj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, 258 bytes
Geez, what a mess. Tons of boilerplate went into calculating moduluses between Gaussian numbers.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*Complex(*(x/y).rect.map(&:to_i))};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;a=b;a,k=k,m[a,k]while k!=0;c/=a=m[c,a]==0?a:a.conj;a}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}
Ruby, (削除) 258 (削除ここまで) 256+8 = 264 bytes
Uses the -rprime flag.
Geez, what a mess. Tons of boilerplate went into calculating moduluses between Gaussian numbers.
Uses this algorithm from stackoverflow.
->c{m=->x,y{x-y*Complex(*(x/y).rect.map(&:to_i))};a=c.abs2.prime_division.map{|b,e|b%4<2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b<3?(b=1+1i)**e:b**e/=2;[b]*e)}.flatten;a[0]*=c;a}