ugly number with DP