I don't understand what it code doing, please help.

How it will be working in python or in another simple language?

```
a = []
a << [1]

for i in 2..10001
    f = 0
    a.each{ |group|
        m = 1
        group.each { |c|
            m *= i % c
        }
        f += m
        if m > 0
            group << i
            break
        end
    }
    a << [i] if f == 0
end

p a
p a.size

```