say 100.by {|n| n.is_composite && (divmod(powmod(10, n-1, n)-1, 9, n) == 0) }.join(' ')