Humble numbers are positive integers which have   no   prime factors    >    7.



Humble numbers are also called   7-smooth numbers,   and sometimes called   highly composite,

although this conflicts with another meaning of   highly composite numbers.



Another way to express the above is:

  humble  =  2i × 3j × 5k × 7m 

           where     i, j, k, m ≥ 0 



Task

   show the first   50   humble numbers   (in a horizontal list)
   show the number of humble numbers that have   x   decimal digits for all   x's   up to   n   (inclusive).
   show   (as many as feasible or reasonable for above)   on separate lines
   show all output here on this page


Related tasks

   Hamming numbers


References

   Wikipedia: Smooth numbers, see the 2nd paragraph.
   OEIS A002473: humble numbers
   University of Ulm, The first 5842 terms of humble numbers


def humble?(i)
  while i % 2 == 0; i /= 2 end
  while i % 3 == 0; i /= 3 end
  while i % 5 == 0; i /= 5 end
  while i % 7 == 0; i /= 7 end
  i == 1
end
 
count, num = 0, 0
digits = 10                        # max digits for humble numbers
limit  = 10 ** digits              # max numbers to search through
humble = Array.new(digits + 1, 0)
 
while (num += 1) < limit
  if humble?(num)
    humble[num.to_s.size] += 1
    print num, " " if count < 50
    count += 1
  end
end
 
print "\n\nOf the first #{count} humble numbers:\n"
(1..digits).each { |num|  printf("%5d have %2d digits\n", humble[num], num) }