f=@(x,y)(1:--x)*~all(mod(1:x,y),1)' f(50,2)f(10,[3;5])f(28,[4;2])f(19,[7;5])f(50,[2;3;5])
Standard input is empty
f = @(x, y) 1:--x * !all (mod (1:x, y), 1)' ans = 600 ans = 23 ans = 182 ans = 51 ans = 857
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!