A360034 Binary representation of -n in base i-1.
0, 11101, 11100, 10001, 10000, 11001101, 11001100, 11000001, 11000000, 11011101, 11011100, 11010001, 11010000, 1110100001101, 1110100001100, 1110100000001, 1110100000000, 1110100011101, 1110100011100, 1110100010001, 1110100010000, 1110111001101, 1110111001100, 1110111000001
Offset: 0
Examples
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. 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.
Links
- Jianing Song, Table of n, a(n) for n = 0..16384
- Wikipedia, Complex-base system
Programs
-
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)
Formula
For n >= 1, a(4*n-0..3) = 10000 * A271472(n) + 0, 1, 1100, 1101 respectively.
Comments