cp's OEIS Frontend

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.

A073790 Numbers in base -9.

This page as a plain text file.
%I A073790 #12 Feb 16 2025 08:32:46
%S A073790 0,1,2,3,4,5,6,7,8,180,181,182,183,184,185,186,187,188,170,171,172,
%T A073790 173,174,175,176,177,178,160,161,162,163,164,165,166,167,168,150,151,
%U A073790 152,153,154,155,156,157,158,140,141,142,143,144,145,146,147,148,130,131
%N A073790 Numbers in base -9.
%D A073790 D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 189.
%H A073790 Chai Wah Wu, <a href="/A073790/b073790.txt">Table of n, a(n) for n = 0..10000</a>
%H A073790 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Negabinary.html">Negabinary</a>
%H A073790 Prepared and presented by Matthew Szudzik of Wolfram Research, <a href="http://library.wolfram.com/conferences/devconf99/challenge/">A Mathematica programming contest</a>
%t A073790 ToNegaBases[i_Integer, b_Integer] := FromDigits@ Rest@ Reverse@ Mod[ NestWhileList[(# - Mod[ #, b])/-b &, i, # != 0 &], b]; Table[ ToNegaBases[n, 9], {n, 0, 60}]
%o A073790 (Python)
%o A073790 def A073790(n):
%o A073790     s, q = '', n
%o A073790     while q >= 9 or q < 0:
%o A073790         q, r = divmod(q, -9)
%o A073790         if r < 0:
%o A073790             q += 1
%o A073790             r += 9
%o A073790         s += str(r)
%o A073790     return int(str(q)+s[::-1]) # _Chai Wah Wu_, Apr 09 2016
%Y A073790 Cf. A007095, A039724, A073785, A007608, A073786, A073787, A073788, A073789 & A039723.
%K A073790 base,easy,nonn
%O A073790 0,3
%A A073790 _Robert G. Wilson v_, Aug 11 2002