MATLAB: Solve: floor(x/5) – floor(x/7) = 1 in Matlab

eq_floorsolve

Sir/Mam, i want to find all the solutions of the equation: floor(x/5) – floor(x/7) = 1 ;where x belongs to Natural Number, so how can i find all its solutions in Matlab? with Thanks

Best Answer

Okay, if this is not a homework, than you find enough information here to solve the problem already. I summarize:
  • Matt J showed, that the results must be 0 <= x <= 35.
  • You can easily check all values:
x = 0:35;
match = (floor(x / 5) - floor(x / 7) == 1);
result = x(match)
And here you get your 17 values.
Related Question