This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A212529 #34 Jul 23 2023 06:05:53 %S A212529 11,10,1101,1100,1111,1110,1001,1000,1011,1010,110101,110100,110111, %T A212529 110110,110001,110000,110011,110010,111101,111100,111111,111110, %U A212529 111001,111000,111011,111010,100101,100100,100111,100110,100001,100000,100011,100010,101101,101100,101111,101110,101001,101000,101011,101010,11010101 %N A212529 Negative numbers in base -2. %C A212529 The formula a(n) = A039724(-n) is slightly misleading because sequence A039724 isn't defined for n < 0, and none of the terms a(n) is a term of A039724. It can be seen as the definition of the extension of A039724 to negative indices. Also, recursive definitions or implementations of A039724 require that function to be defined for negative arguments, and using a generic formula it will work as expected for -n, n > 0. - _M. F. Hasler_, Oct 18 2018 %H A212529 Joerg Arndt, <a href="/A212529/b212529.txt">Table of n, a(n) for n = 1..1000</a> %H A212529 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, pp. 58-59. %F A212529 a(n) = A039724(-n). - _Reinhard Zumkeller_, Feb 05 2014 %p A212529 a:= proc(n) local d, i, l, m; %p A212529 m:= n; l:= NULL; %p A212529 for i from 0 while m>0 do %p A212529 d:= irem(m, 2, 'm'); %p A212529 if d=1 and irem(i, 2)=0 then m:= m+1 fi; %p A212529 l:= d, l %p A212529 od; parse(cat(l)) %p A212529 end: %p A212529 seq(a(n), n=1..100); # _Alois P. Heinz_, May 20 2012 %t A212529 negabin[n_] := negabin[n] = If[n == 0, 0, negabin[Quotient[n - 1, -2]]*10 + Mod[n, 2]]; a[n_] := negabin[-n]; Array[a, 50] (* _Amiram Eldar_, Jul 23 2023 *) %o A212529 (Haskell) %o A212529 a212529 = a039724 . negate -- _Reinhard Zumkeller_, Feb 05 2014 %o A212529 (Python) %o A212529 def A212529(n): %o A212529 s, q = '', -n %o A212529 while q >= 2 or q < 0: %o A212529 q, r = divmod(q, -2) %o A212529 if r < 0: %o A212529 q += 1 %o A212529 r += 2 %o A212529 s += str(r) %o A212529 return int(str(q)+s[::-1]) # _Chai Wah Wu_, Apr 09 2016 %o A212529 (PARI) A212529(n)=A039724(-n) \\ _M. F. Hasler_, Oct 16 2018 %Y A212529 Cf. A039724 (nonnegative numbers in base -2). %Y A212529 Cf. A007608 (nonnegative numbers in base -4), A212526 (negative numbers in base -4). %Y A212529 Cf. A005352. %K A212529 nonn,base %O A212529 1,1 %A A212529 _Joerg Arndt_, May 20 2012