def get_multis(n, i, j):
x = 0
while n > 0:
if(x%i == 0 or x%j == 0): # modulo para ver se e multiplo de algum ou ambos
yield x
n -= 1
x += 1
n, i, j = 6, 2, 3
print(list(get_multis(n, i, j))) # [0, 2, 3, 4, 6, 8]
ZGVmIGdldF9tdWx0aXMobiwgaSwgaik6CiAgICB4ID0gMAogICAgd2hpbGUgbiA+IDA6CiAgICAgICAgaWYoeCVpID09IDAgb3IgeCVqID09IDApOiAjIG1vZHVsbyBwYXJhIHZlciBzZSBlIG11bHRpcGxvIGRlIGFsZ3VtIG91IGFtYm9zCiAgICAgICAgICAgIHlpZWxkIHgKICAgICAgICAgICAgbiAtPSAxCiAgICAgICAgeCArPSAxCgpuLCBpLCBqID0gNiwgMiwgMwpwcmludChsaXN0KGdldF9tdWx0aXMobiwgaSwgaikpKSAjIFswLCAyLCAzLCA0LCA2LCA4XQ==