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.

Showing 1-3 of 3 results.

A039723 Numbers in base -10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 150, 151, 152, 153, 154, 155
Offset: 0

Views

Author

Robert Lozyniak (11(AT)onna.com)

Keywords

Examples

			Decimal 25 is "185" in base -10 because 100 - 80 + 5 = 25.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 189.

Crossrefs

Nonnegative numbers in negative bases: this sequence (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).
Cf. A051022.
Cf. A305238: negative numbers in base -10.

Programs

  • Haskell
    a039723 0 = 0
    a039723 n = a039723 n' * 10 + m where
       (n',m) = if r < 0 then (q + 1, r + 10) else qr where
                qr@(q, r) = quotRem n (negate 10)
    -- Reinhard Zumkeller, Apr 20 2011
    
  • Mathematica
    ToNegaBases[i_Integer, b_Integer] := FromDigits@ Rest@ Reverse@ Mod[ NestWhileList[(# - Mod[ #, b])/-b &, i, # != 0 &], b]
  • PARI
    A039723 = base(n, b=-10) = if(n, base(n\b, b)*10 + n%b, 0) \\ M. F. Hasler, Oct 16 2018 [Corrected by Jianing Song, Oct 21 2018]
  • Python
    def A039723(n):
        s, q = '', n
        while q >= 10 or q < 0:
            q, r = divmod(q, -10)
            if r < 0:
                q += 1
                r += 10
            s += str(r)
        return int(str(q)+s[::-1]) # Chai Wah Wu, Apr 10 2016
    

A106649 Replace each digit d (except the leading one) of n with 9-d.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 79, 78, 77
Offset: 0

Views

Author

Zak Seidov, May 12 2005

Keywords

Comments

By definition, one-digit numbers do not change.
Differs from A003100 starting with a(21)=29: A003100(21)=20.

Crossrefs

Programs

  • Mathematica
    a[n_]:=FromDigits[Flatten[{IntegerDigits[n][[1]], Map[9-#&, Drop[IntegerDigits[n], 1]]}]];Table[a[n], {n, 0, 100}]

Formula

a(n) = n if n < 10, otherwise 10*a(floor(n/10)) + 9 - n mod 10; a self-inverse permutation of the natural numbers, A115310(n+8, 9) = a(n) for n > 0. - Reinhard Zumkeller, Jan 20 2006 [corrected by Georg Fischer, Jun 23 2024]
a(n) = A305238(n-9) for 10 <= n <= 99. - M. F. Hasler, Oct 16 2018

A320636 Negative numbers in base -3.

Original entry on oeis.org

12, 11, 10, 22, 21, 20, 1202, 1201, 1200, 1212, 1211, 1210, 1222, 1221, 1220, 1102, 1101, 1100, 1112, 1111, 1110, 1122, 1121, 1120, 1002, 1001, 1000, 1012, 1011, 1010, 1022, 1021, 1020, 2202, 2201, 2200, 2212, 2211, 2210, 2222, 2221, 2220, 2102, 2101, 2100, 2112
Offset: 1

Views

Author

Jianing Song, Oct 18 2018

Keywords

Comments

Extend A073785 to negative-indexed terms, then a(n) = A073785(-n).

Examples

			-7 in base -3 is represented as 1202 (1*(-3)^3 + 2*(-3)^2 + 2 = -7), so a(7) = 1202;
-16 in base -3 is represented as 1102 (1*(-3)^3 + 1*(-3)^2 + 2 = -16), so a(16) = 1102;
-40 in base -3 is represented as 2222 (2*(-3)^3 + 2*(-3)^2 + 2*(-3) + 2 = -99), so a(40) = 2222.
		

Crossrefs

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).
Negative numbers in negative bases: A305238 (b=-10), A212529 (b=-2), this sequence (b=-3), A212526 (b=-4).

Programs

Showing 1-3 of 3 results.