[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A271472
Binary representation of n in base i-1.
10
0, 1, 1100, 1101, 111010000, 111010001, 111011100, 111011101, 111000000, 111000001, 111001100, 111001101, 100010000, 100010001, 100011100, 100011101, 100000000, 100000001, 100001100, 100001101, 110011010000, 110011010001, 110011011100, 110011011101, 110011000000, 110011000001
OFFSET
0,3
COMMENTS
This is A066321 converted from base 10 to base 2.
Every Gaussian integer r+s*i (r, s ordinary integers) has a unique representation as a sum of powers of t = i-1. For example 3 = 1+b^2+b^3, that is, "1101" in binary, which explains a(3) = 1101. See A066321 for further information.
From Jianing Song, Jan 22 2023: (Start)
Also binary representation of n in base -1-i.
Write out n in base -4 (A007608), then change each digit 0, 1, 2, 3 to 0000, 0001, 1100, 1101 respectively. (End)
REFERENCES
D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 172. (See also exercise 16, p. 177; answer, p. 494.)
W. J. Penney, A "binary" system for complex numbers, JACM 12 (1965), 247-248.
PROG
(Python)
from gmpy2 import c_divmod
u = ('0000', '1000', '0011', '1011')
def A271472(n):
if n == 0:
return 0
else:
s, q = '', n
while q:
q, r = c_divmod(q, -4)
s += u[r]
return int(s[::-1]) # Chai Wah Wu, Apr 09 2016
(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)
CROSSREFS
Cf. A066321.
Sequence in context: A281039 A078199 A350709 * A147816 A050926 A083933
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Apr 08 2016
STATUS
approved