[seqfan] Re: Sum of digits in base -2 and base 4

Kevin Ryde user42_kevin at yahoo.com.au
Thu Sep 6 08:52:59 CEST 2018

kfl at KeithLynch.net (Keith F. Lynch) writes:
> I just noticed that the sum of the digits of each of the numbers 0
> through 13 was the same in base -2 and in base 4.  Why should that be?
> There's no obvious pattern linking them.

Contemplating base 4 digits taken low to high, how they become base -2,
and trying some code, I make them different when base 4 contains a digit
run 311..112 or 311..113, with zero or more 1s.  So first different at
32 base4 = 14 decimal.  The equivalent in base -2 is I think any 001
with the 1 at an odd position (counting least significant digit as
position 0).

> Through 100, the base 4 sum of digits agrees with the base -2 sum of
> digits 81 times.  Through 1000, they agree 560 times.

Ranges like 4^k may have more pattern if you were making some counts.
Looks like number of "same sum" in 0<=n<4^k is A007070.  Or its friend
A068912 for <2^k.

> When they disagree, the latter always exceeds
> the former, and does so by a small multiple of 3

I think each run 311..112 or 311..113 causes a shortfall of 3, umm,
probably.  That's with overlaps allowed, so the high 3 of one run can be
the low 3 of another above it.

More information about the SeqFan mailing list