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 A320636 #16 Feb 16 2025 08:33:56 %S A320636 12,11,10,22,21,20,1202,1201,1200,1212,1211,1210,1222,1221,1220,1102, %T A320636 1101,1100,1112,1111,1110,1122,1121,1120,1002,1001,1000,1012,1011, %U A320636 1010,1022,1021,1020,2202,2201,2200,2212,2211,2210,2222,2221,2220,2102,2101,2100,2112 %N A320636 Negative numbers in base -3. %C A320636 Extend A073785 to negative-indexed terms, then a(n) = A073785(-n). %H A320636 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Negadecimal.html">Negadecimal</a> %H A320636 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Negabinary.html">Negabinary</a> %H A320636 Wikipedia, <a href="http://en.wikipedia.org/wiki/Negative_base">Negative base</a> %e A320636 -7 in base -3 is represented as 1202 (1*(-3)^3 + 2*(-3)^2 + 2 = -7), so a(7) = 1202; %e A320636 -16 in base -3 is represented as 1102 (1*(-3)^3 + 1*(-3)^2 + 2 = -16), so a(16) = 1102; %e A320636 -40 in base -3 is represented as 2222 (2*(-3)^3 + 2*(-3)^2 + 2*(-3) + 2 = -99), so a(40) = 2222. %o A320636 (PARI) A073785 = base(n, b=-3) = if(n, base(n\b, b)*10 + n%b, 0) %o A320636 a(n) = A073785(-n) %o A320636 (Python) %o A320636 def A073785(n): # after _Reinhard Zumkeller_ %o A320636 if n == 0: return 0 %o A320636 (q, r) = divmod(n, -3) %o A320636 (nn, m) = (q, r) if r >= 0 else (q+1, r+3) %o A320636 return A073785(nn)*10 + m %o A320636 def a(n): return A073785(-n) %o A320636 print([a(n) for n in range(1, 47)]) # _Michael S. Branicky_, Dec 11 2021 %Y A320636 Nonnegative numbers in negative bases: A039723 (b=-10), A039724 (b=-2), A073785 (b=-3), A007608 (b=-4), A073786 (b=-5), A073787 (b=-6), A073788 (b=-7), A073789 (b=-8), A073790 (b=-9). %Y A320636 Negative numbers in negative bases: A305238 (b=-10), A212529 (b=-2), this sequence (b=-3), A212526 (b=-4). %K A320636 nonn,base %O A320636 1,1 %A A320636 _Jianing Song_, Oct 18 2018