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.

A073788 Numbers in base -7.

This page as a plain text file.
%I A073788 #10 Feb 16 2025 08:32:46
%S A073788 0,1,2,3,4,5,6,160,161,162,163,164,165,166,150,151,152,153,154,155,
%T A073788 156,140,141,142,143,144,145,146,130,131,132,133,134,135,136,120,121,
%U A073788 122,123,124,125,126,110,111,112,113,114,115,116,100,101,102,103,104,105
%N A073788 Numbers in base -7.
%D A073788 D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 189.
%H A073788 Chai Wah Wu, <a href="/A073788/b073788.txt">Table of n, a(n) for n = 0..10000</a>
%H A073788 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Negabinary.html">Negabinary</a>
%H A073788 Prepared and presented by Matthew Szudzik of Wolfram Research, <a href="http://library.wolfram.com/conferences/devconf99/challenge/">A Mathematica programming contest</a>
%t A073788 ToNegaBases[i_Integer, b_Integer] := FromDigits[ Rest[ Reverse[ Mod[ NestWhileList[(#1 - Mod[ #1, b])/-b &, i, #1 != 0 &], b]]]]; Table[ ToNegaBases[n, 7], {n, 0, 60}]
%o A073788 (Python)
%o A073788 def A073788(n):
%o A073788     s, q = '', n
%o A073788     while q >= 7 or q < 0:
%o A073788         q, r = divmod(q, -7)
%o A073788         if r < 0:
%o A073788             q += 1
%o A073788             r += 7
%o A073788         s += str(r)
%o A073788     return int(str(q)+s[::-1]) # _Chai Wah Wu_, Apr 09 2016
%Y A073788 Cf. A007093, A039724, A073785, A007608, A073786, A073787, A073789, A073790 & A039723.
%K A073788 base,easy,nonn
%O A073788 0,3
%A A073788 _Robert G. Wilson v_, Aug 11 2002