Number of 1s in after converting number to base -1+i

129 Views Asked by At

Regarding to

Base conversion: How to convert between Decimal and a Complex base?

Let $s(a,b)$ is a number of $1$ after converting complex number $a+bi$ to base $-1+i$. It's easy to implement that conversion algorithm.

Can anybody suggest how we can calculate $\sum_{a=-L}^{L}\sum_{b=-L}^{L}s(a,b)$ for $L=10^{15}$. Simple bruteforce will not work for such big number. There should be some kind of pattern for it.

1

There are 1 best solutions below

0
On

There are some rules:

$$a+bi=\left|\sqrt{a^2+b^2}\right|e^{arg\left(a+bi\right)i}=$$ $$\left|\sqrt{a^2+b^2}\right|\left(cos\left(arg\left(a+bi\right)\right)+sin\left(arg\left(a+bi\right)\right)i\right)$$

Were arg(x) is the argument of the function and |x| the absolute value.