#Mathematica <s>82</s> 35
n_~u~p_:=FactorInteger[n][[-1,1]]≤p
**Usage**
u[1, 5]
u[74, 5]
u[75, 5]
>True, False, True
----------
**Check for Ugly Numbers in the interval {342012, 342035} that have prime factors no greater than 245**
Prime factors and their powers are in the center column.
Table[{342010 + t, FactorInteger[342010 + t], u[342010 + t, 245]}, {t,25}] // Grid
![data][1]
[1]: https://i.sstatic.net/Rbw6y.png