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?
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?
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$?