June 28th, 2019, 12:53 PM  #1 
Newbie Joined: Jun 2019 From: Italy Posts: 7 Thanks: 0  Sum of number's number
Hey, I have a number theory problem: determine the sum of the digits of a natural number. I have been thinking about it for a lot time during this days, but I can't still find a solution. Can someone give me an idea or advise me a book/internet site with something useful? Thank a lot. 
June 28th, 2019, 01:48 PM  #2 
Global Moderator Joined: May 2007 Posts: 6,786 Thanks: 708 
Add them up? What are you looking for?

June 28th, 2019, 03:33 PM  #3 
Member Joined: Jun 2019 From: USA Posts: 69 Thanks: 27 
I can find it modulo 9 no problem. 
June 28th, 2019, 05:52 PM  #4 
Member Joined: Oct 2018 From: USA Posts: 87 Thanks: 59 Math Focus: Algebraic Geometry 
This seems pretty brute force, wouldn't surprise me at all if there was something more elegant. Let each digit $d_i \in \{0,1,2 \dots , 9\}$ be such that $\displaystyle d_{1}d_{2}d_{3} \dots d_{N} = a \in \mathbb{N}$ (This is concatenation, but also $\displaystyle a= \sum_{i=1}^{N} d_{i}10^{(Ni)}$ ) Then we know $d_1 = floor \left(10^{(N1)}a \right)$ Now, we know $a10^{(N1)}d_{1} = d_{2}d_{3} \dots d_{N}$ thus $d_{2} = floor \left(10^{(N2)} \left(a10^{(N1)}d_{1} \right) \right)$ and $d_{3} = floor \left(10^{(N3)} \left(a10^{(N1)}d_{1}  10^{(N2)}d_{2} \right) \right)$ Continuing this strategy leaves $\displaystyle d_{n} = floor \left( 10^{(Nn)} \left( a  \sum_{i=1}^{n1} d_{i}10^{(Ni)} \right) \right) $ So, the sum of digits should be $\displaystyle \sum_{i=1}^{N}d_{i} = floor \left(10^{(N1)}a \right) + \sum_{n=2}^{N} floor \left( 10^{(Nn)} \left( a  \sum_{i=1}^{n1} d_{i}10^{(Ni)} \right) \right)$ For $N \geq 2$ Last edited by Greens; June 28th, 2019 at 06:06 PM. Reason: Negative Signs 
June 28th, 2019, 11:34 PM  #5 
Newbie Joined: Jun 2019 From: Italy Posts: 7 Thanks: 0 
Thanks for your answer. I tried with another different way: Let $\displaystyle d_i \in \{0,1,2 \dots , 9\}$ and $\displaystyle \displaystyle d_{1}d_{2}d_{3} \dots d_{N} = a \in \mathbb{N}$ Now I know that each digit is generated by: $\displaystyle d_i = \sum_{i=1}^{\left \lfloor log_{10}(A)+1 \right \rfloor}\frac{A\,\, mod\,\, 10^{i}A\,\, mod\,\, 10^{i1}}{10^{i1}}$ I expand the sum and I obtain: $\displaystyle \frac{A\, mod\,\, 10A\,\, mod\,\, 1}{1}+\frac{A\, mod\,\, 10^{2}A\,\, mod\,\, 10}{10}+\cdots +\frac{A\, mod\,\, 10^{i}A\,\, mod\,\, 10^{i1}}{10^{i1}}$ I have to simplify the denominator so: $\displaystyle \frac{1\cdot (A\, mod\,\, 10A\,\, mod\,\, 1)}{1}+\frac{10\cdot (\frac{A}{10}\, mod\,\, 10\frac{A}{10}\,\, mod\,\, 1)}{10}+\cdots +\frac{10^{i1}\cdot (\frac{A}{10^{i1}}\, mod\,\, 10\frac{A}{10^{i1}}\,\, mod\,\, 1)}{10^{i1}}$ I split the term: $\displaystyle A\, \, mod\, \, 10+\frac{A}{10}\, \, mod\, \, 10+\cdots+\frac{A}{10^{i1}}\, \, mod\, \, 10(A\, \, mod\, \, 1+\frac{A}{10}\, \, mod\; 1+\cdots +\frac{A}{10^{i1}}\, \, mod\, \, 1)$ Now I would have picked up $\displaystyle mod\,\,10$ and $\displaystyle mod\,\,1$: $\displaystyle \left (\sum_{i=1}^{\left \lfloor log_{10}(A)+1 \right \rfloor}\frac{A}{10^{i1}}\right)\, \, mod\, \, 10\left (\sum_{i=1}^{\left \lfloor log_{10}(A)+1 \right \rfloor}\frac{A}{10^{i1}}\right)\, \, mod\, \, 1$; but I can't; some ideas to move forward? Can we move from this sum to a function without $\displaystyle \sum$? 

Tags 
function, number, number theory, sum 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
The number of all combinations of limited number of elements is infinite?  Germann  Advanced Statistics  1  March 12th, 2019 09:34 AM 
The relationships between Prime number and Fibonacci number (Part 2)  thinhnghiem  Math  0  May 15th, 2018 08:07 AM 
Prove a large number of samplings converge to a set of small number of samples  thanhvinh0906  Advanced Statistics  3  August 30th, 2017 04:27 PM 
natural number multiple of another number if its digit sum equal to that number  Shen  Elementary Math  2  June 5th, 2014 07:50 AM 
Number of Necklace/Bracelets With Fixed Number of Beads  UnreasonableSin  Number Theory  2  June 13th, 2010 12:03 AM 