1

I am trying to solve problem 2.9.3 in Artin's Algebra book.

Prove that every integer $a$ is congruent to the sum of its decimal digits modulo $9$.

This question has been asked in several other places, including here. I know how to treat the case where $a \geq 0$ by writing $a = \sum\limits_{i=0}^n a_i 10^i$ and using the fact that $10^i \equiv 1 \pmod 9$. What I don't understand is how this generalizes to the case where $a < 0$. For example, say that $$ a = -3456. $$ I don't know how to denote its sum. Some options are: \begin{align*} 3 + 4 + 5 + 6 \\ \pm 1 (3 + 4 + 5 + 6) \\ -3 + 4 + 5 + 6. \end{align*} If my calculations with this simple example are correct, the first two end up giving $0$, which is congruent to both $3456$ and $-3456$. The third does not. I don't believe it's true in general that $a \equiv -a \pmod 9$ (e.g., $-1 \not \equiv 1 \pmod 9$). But I'm not sure if there's a different way to treat the $a < 0$ or to define the sum so that the result holds for every integer. Most proofs of this fact I have seen seem to only treat the case where $a \geq 0$.

  • 1
    This is not clear. As you have noticed, the real issue is "how are you defining the sum of digits of a negative integer?". How is it defined? Wolfram Alpha appears to define it as the sum of digits of the absolute value. That's not a proof of anything, just an illustration of the convention they are following. Of course, with that convention, the desired claim is false for, say, $n=-1$. – lulu Apr 12 '25 at 14:08
  • Considering that, in base $b$ (e.g., $10$), the digits represent the coefficients of each greater power of $b$, with the sum being the number, then for example $12=1\times 10^1+1\times 10^0$. How then would $-12$, or any other multi-digit negative number, need to work in terms of what the coefficients would have to be. – John Omielan Apr 12 '25 at 14:28
  • 1
    If $A \equiv B \pmod 9$ then $-A \equiv -B\equiv 9 - B \pmod 9$. So for the theorem to be consistent it should be obvious we'd have to assume the digits of $-2165$ are $-2,-1,-6,-5$. This would make sense as per John Hughes observation if $A =\sum a_i 10^n$ and $A<0$ then $a_i$ must all be negative. I personally find it more natural to assume "the digits" to refer to positive values and "negating" requires a single flurish/exception. And the theorem can be modified (sum of neg cong to neg of sum). But there is utterly no rational or logic for the third option. It just makes zero sense. – fleablood Apr 12 '25 at 14:49
  • @fleablood Balanced residues systems (e.g. $\pm {0,1,2,3,4}\bmod 9)$ often simplify mod arithmetic. When used to reduce integers in radix rep this involves using "negative" digits, e.g. see here. More generally we can reduce both the variable's values and the coef's when modularly evaluating a polynomial, see here. $\ \ $ – Bill Dubuque Apr 12 '25 at 16:30

2 Answers2

2

If you think of $-3456$ as $$ -3456 = -3 \cdot 10^3 + (-4) \cdot 10^2 + (-5) \cdot 10^1 + (-6), $$ i.e., the "digits" are $-3, -4, -5,$ and $-6$, then the theorem's claim is true, so one might (with some diffidence) decide that this is what Artin probably meant.

Perhaps more likely is that Artin meant "natural number" rather than "integer", and just slipped up.

John Hughes
  • 100,827
  • 4
  • 86
  • 159
  • 4
    For whatever it's worth, I agree that "natural number" was probably intended. I just skimmed the relevant chapter in Artin and saw no other references to a sum of digits function. – lulu Apr 12 '25 at 14:40
  • Right. It's awfully easy to slip up in ways like this. – John Hughes Apr 12 '25 at 14:51
  • Thing is the concept of decimal represenation is usually stated (more or less) as the digits are integers between $0$ inclusive and the base exclusive. As such only non-negative numbers need apply and negative numbers is just "added florish". If so, this observation requires a simple modification that the a negative integer is congruent to the negative of the sum of its digits. .... or we can redefine "digits" to allow negative digits. It's been said, in math we can define or do whatever we want so long as we are consistent and clear. – fleablood Apr 12 '25 at 15:02
  • Oh, absolutely -- I agree that this is the usual definition, and it's usually applied to naturals. I was making a (more or less) natural extension to negative numbers that allowed the theorem to make sense and be proved, not suggesting in any way that the OP should have "known" this or that it's in any way a generally-acknowledged "digit" representation. – John Hughes Apr 12 '25 at 15:21
  • I do like this notion of "digits" (the "a_i" must be less than the base in absolute value) because it gives a unique representation as a sum of distinct powers of the base that exactly matches what we already have for naturals, while the 'negate later' model requires the addition of an extra factor (the "sign") which kind of irks me. But that's all a matter of mathematical aesthetics, as you know. – John Hughes Apr 12 '25 at 15:33
0

Another alternative answer is that if we write $$ n = \sum_i a_i 10^i $$ then regardless of what conditions we place on the $a_i$s (e.g. "must be between 0 and 9" or "$-10 < a_i < 10$ for all $i$" or "no restrictions at all"), then the original proof shows that $$ n \equiv \sum_i a_i \bmod 9 $$ Since writing a number as a sum of multiples of powers of $10$ is what we do in describing digits, this covers all cases. It also allows weird things like $$ -312 = (-32)\cdot 10^1 + 8 \cdot 10^0 $$ which lets you conclude that $$ -312 \equiv -24 \bmod 9, $$ which is presumably something that no one has ever wanted to know. :)

Using non-small "digits" seems like a wacky idea until you look at something like the Cantor representation.

John Hughes
  • 100,827
  • 4
  • 86
  • 159
  • Please strive not to post more (dupe) answers to dupes of FAQs (& PSQs), cf. site policy announcement here. – Bill Dubuque Apr 12 '25 at 16:04
  • The most natural "duplicate" of this question (https://math.stackexchange.com/questions/99725/every-integer-is-congruent-to-the-sum-of-its-digits-mod-9?noredirect=1&lq=1) has the right title, but in fact fails to address the case of negative integers, which is the central aspect of this question. – John Hughes Apr 13 '25 at 11:36