http://blog.garritys.org/2012/12/base-i-1-there-be-dragons.html
As the link above shows, it's possible to represent every Gaussian integer by converting a number N into its binary representation and then expressing it in base (i-1). The number N can be considered a point of the graph.
This process generates a dragon curve, and what I'd like to know is the sum of bits that correspond to the binary representation of each point in a given range $[(-a,a),(-a,a)]$.
For example, in the range $[(-1,1),(-1,1)]$ the sum of bits would be $20$, since the sum of bits $S_{b}$ in each vertex is:
$S_{b}(1) = 1$
$S_{b}(2) = 1$
$S_{b}(3) = 2$
$S_{b}(6) = 2$
$S_{b}(7) = 3$
$S_{b}(14) = 3$
$S_{b}(29) = 4$
$S_{b}(58) = 4$
So the total sum of bits $S_{t}(1) = 20$ ($58$ is not plotted in the graphic shown in the article, but it would represent $-i+1$, the only point missing).
The following link provides information regarding the twindragon curve and its generation: https://metacpan.org/pod/Math::PlanePath::ComplexMinus#DESCRIPTION
In the "DESCRIPTION" section, it explains the pattern that assigns the values of a certain range of the dragon curve.
N=0 to N=7 N=8 to N=15 repeat shape 2 3 10 11 0 1 8 9 6 7 14 15 4 5 12 13 $(i-1)^3 = 2+2i$ so the pattern in the right starts with $8$ in $X=2,Y=2$-
I'm almost certain that this is all the information needed to calculate the sum of the bits within a given range. However, I don't know exactly what this particular approach should be.



-O3tog++) then N = 5000 completes in 16 seconds. $\endgroup$