Home > Back-end >  [b] C algorithm of a simple calculation of the input 4 digits to several loops [/b]
[b] C algorithm of a simple calculation of the input 4 digits to several loops [/b]

Time:04-26

We start with any positive integer, such as 9246, the sum of squares of its digits (81 + 4 + 16 + 36=137), for this number to do the same thing again (137 1 + 9 + 49=59) is given, and the results repeat this step at a time, so you get an integer sequence, for our example, the sequence is: 9246137,59,106,37,58,89,145,42,20,... So, no matter what people selected at the beginning of an integer, the resulting sequence, or a number 1 (and apparently after 1 will never repeat this number), or a number 4 (and has been a recurring after 4 4,16,37,58,89,145,42,20), - on the proprietaries, "in the" math - r. to repel the belgae
We know that once the sum to 1, then there is always is 1, circulation, once the sum to 4, that is the cycle, "4,16,37,58,89,145,42,20,4" *
  • Related