Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,19 @@
def mdroot(n)
mdr, persist = n, 0
until mdr < 10 do
mdr = mdr.to_s.each_char.map(&:to_i).inject(:*)
persist += 1
end
[mdr, persist]
end
puts "Number: MDR MP", "====== === =="
[123321, 7739, 893, 899998].each{|n| puts "%6d: %d %2d" % [n, *mdroot(n)]}
counter = Hash.new{|h,k| h[k]=[]}
0.step do |i|
counter[mdroot(i).first] << i
break if counter.values.all?{|v| v.size >= 5 }
end
puts "", "MDR: [n0..n4]", "=== ========"
10.times{|i| puts "%3d: %p" % [i, counter[i].first(5)]}