All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Some definite results (Posted on 2015-09-17) Difficulty: 3 of 5
Find the possible outcomes of the following algorithm:

1.Take a random positive integer, divisible by three.
2.Consider its base 10 digits.
3.Take the sum of their cubes.
4.Go back to step 2.

Rem: You may limit your research for n<1000.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
non-analytic solution | Comment 1 of 5
Note that if the number of digits is five or more, then the sum of the cubes of those digits has fewer digits than before. So necessarily, any sequence that starts with a number >= 10000 will include at least one number < 10000.

The following ruby code returns a list of all of the unique values resulting from each starting point < 10000 and iterating no more than 14 times:

def iterated_sum_of_digits_cubed(num)
   14.times do
      num = num.to_s.split('').reduce(0){|tot,k| tot += k.to_i**3}
   end
   num
end
(1..3334).map{|x| iterated_sum_of_digits_cubed(3*x) }.uniq

It returns the list: [153]

Since every sequence starting with a number < 10000 ends with 153, and since ever sequence starting with a number >= 10000  contains a subsequence starting with such a number, then all sequences end with 153.

Note: the value 14 was determined empirically; at least one starting number doesn't make it to 153 until the 14th iteration. The value 3334 is the smallest number such that triple it is > 10000

  Posted by Paul on 2015-09-17 14:53:14
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information