TOPICS
Search

Negadecimal


The negadecimal representation of an integer n is its representation in base -10 (i.e., base negative 10). It is therefore given by the digits a_ma_(m-1)...a_1a_0 in

n=sum_(i=0)^(m)a_i(-10)^i
(1)
=...+a_2(-10)^2+a_1(-10)^1+a_0(-10)^0,
(2)

where m is a nonnegative integer and each a_i is one of the digits 0, 1, ..., 9. Leading zeros are omitted, and 0 is represented by the single digit 0.

The negadecimal digits may be obtained with the Wolfram Language code

Negadecimal[0] := {0}
 Negadecimal[i_Integer] := Rest @ Reverse @
 Mod[NestWhileList[(# - Mod[#, 10])/-10&,
 i, # != 0& ], 10]

The following table gives the negadecimal representations for the first few integers (OEIS A039723).

nnegadecimalnnegadecimalnnegadecimal
111119121181
221219222182
331319323183
441419424184
551519525185
661619626186
771719727187
881819828188
991919929189
101902018030170

The numbers having the same decimal and negadecimal representations are the finite sums sum_(i=0)^(m)a_i100^i with coefficients a_i=0, 1, ..., 9. Their positive values begin 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 200, ... (OEIS A051022).


See also

Base, Decimal, Negabinary

Explore with Wolfram|Alpha

References

Sloane, N. J. A. Sequences A039723 and A051022 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Negadecimal

Cite this as:

Weisstein, Eric W. "Negadecimal." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Negadecimal.html

Subject classifications