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


function isHumble(n)
    local n2 = math.floor(n)
 
    if n2 <= 1 then
        return true
    end
    if n2 % 2 == 0 then
        return isHumble(n2 / 2)
    end
    if n2 % 3 == 0 then
        return isHumble(n2 / 3)
    end
    if n2 % 5 == 0 then
        return isHumble(n2 / 5)
    end
    if n2 % 7 == 0 then
        return isHumble(n2 / 7)
    end
 
    return false
end
 
function main()
    local limit = 10000
    local humble = {0, 0, 0, 0, 0, 0, 0, 0, 0}
    local count = 0
    local num = 1
 
    while count < limit do
        if isHumble(num) then
            local buffer = string.format("%d", num)
            local le = string.len(buffer)
            if le > 9 then
                break
            end
            humble[le] = humble[le] + 1
 
            if count < 50 then
                io.write(num .. " ")
            end
            count = count + 1
        end
        num = num + 1
    end
    print("\n")
 
    print("Of the first " .. count .. " humble numbers:")
    for num=1,9 do
        print(string.format("%5d have %d digits", humble[num], num))
    end
end
 
main()