Project Euler #153: Investigating Gaussian Integers

  • + 2 comments

    Hi guys,

    would anybody be so nice to explain to me, how 2+2i is a divisor of 4. My result is

    (4*(2-2i)) / 8

    Which shouldn't be a divisor if I understood everything correctly.

    Thanks in advance.

    • + 1 comment

      take 2 common from the complex number -> 4*2(1-i)/8 => 1-i, which clearly indicates that 2+2i is divisor of 4.

      • + 0 comments

        Thank you. That makes sense.

    • + 0 comments

      (4*(2-2i))/8=(8-8i)/8=(1-i)