login
Binary representation of -n in base i-1.
1

%I #16 Jan 23 2023 16:18:14

%S 0,11101,11100,10001,10000,11001101,11001100,11000001,11000000,

%T 11011101,11011100,11010001,11010000,1110100001101,1110100001100,

%U 1110100000001,1110100000000,1110100011101,1110100011100,1110100010001,1110100010000,1110111001101,1110111001100,1110111000001

%N Binary representation of -n in base i-1.

%C Note that each Gaussian integer has one and only one base-(i-1) representation.

%C Also binary representation of -n in base -1-i.

%C Write out -n in base -4 (A212526), then change each digit 0, 1, 2, 3 to 0000, 0001, 1100, 1101 respectively.

%H Jianing Song, <a href="/A360034/b360034.txt">Table of n, a(n) for n = 0..16384</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Complex-base_system">Complex-base system</a>

%F For n >= 1, a(4*n-0..3) = 10000 * A271472(n) + 0, 1, 1100, 1101 respectively.

%e a(1) = 11101 since -1 = (i-1)^4 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -1 is 13_(-4), so changing 1 to 0001 and 3 to 1101 yields 11101.

%e a(5) = 11001101 since -5 = (i-1)^7 + (i-1)^6 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -5 is 23_(-4), so changing 2 to 1100 and 3 to 1101 yields 11001101.

%o (PARI) a(n) = my(v = [-n,0], x=0, digit=0, a, b); while(v!=[0,0], a=v[1]; b=v[2]; v[1]=-2*(a\2)+b; v[2]=-(a\2); x+=(a%2)*10^digit; digit++); x \\ _Jianing Song_, Jan 22 2023; [a,b] represents the number a + b*(-1+i)

%Y This is A256441 converted from base 10 to base 2. Cf. also A271472.

%K nonn,base,easy

%O 0,2

%A _Jianing Song_, Jan 22 2023