0

Suppose n = 12345

The sum of the digits of n = 1 + 2 + 3 + 4 + 5 = 15

For example, in Python, we might isolate the digit 1 by writing n[0].

How would one represent the digits of n mathematically?

sammy
  • 523
  • 4
    Perhaps write $n=\sum \limits_{k=0}^m\left(a_m10^m\right)$, for some natural number $m$ and integers $a_1, \ldots, a_m$. – Git Gud Jul 21 '16 at 23:39
  • Please do not edit questions to have a new meaning after you have already gotten answers. At least not without specifically stating the edits to the question in the question. – mathreadler Jul 24 '16 at 15:22
  • I removed the example that was misleading. The questions i.e. the statements with a question mark at the end of them, are the same. – sammy Jul 24 '16 at 16:38

2 Answers2

5

This is wrong. $6$ divides the sum of the digits of $15$, but $6$ does not divide $15$. $6$ divides $12$, but $6$ does not divide the sum of the digits of $12$.

What is true is that $3$ divides $n$ if and only if $3$ divides the sum of the digits of $n$. $6$ divides $n$ if and only if $3$ divides the sum of the digits of $n$ and the last digit of $n$ is even.

... or maybe you're working in base $7$?

Robert Israel
  • 448,999
  • Similarly, $ 6 | 36$, but $6 \nmid (3 + 6)$ – Owain West Jul 21 '16 at 23:41
  • The truthfulness of the statement was not the point. I did not expect the statement to be true. The point of this question was to find out how to represent "the digits of n" mathematically – sammy Jul 23 '16 at 21:56
  • Then why don't you ask the question you really wanted to ask, rather than wasting our time with a different question? – Robert Israel Jul 24 '16 at 05:50
  • Please read the title of the post and any sentence with a question mark punctuating it. – sammy Jul 24 '16 at 14:58
  • I edited the question to be more clear. You can delete your post now if you like. – sammy Jul 24 '16 at 15:09
0

I found a solution.

Since any integer n = a0 + (a1)(10) + (a2)(102) + ... + (ax)(10x)

Then the sum of digits = a0 + a1 + a2 + ...

sammy
  • 523