#PHP, 63+1 bytes <!-- language: lang-php --> while(($i+=$n=$argn)%10-$n|array_sum(str_split($i))-$n);echo$i; Run as pipe with `-R`. loops `$i` through multiples of `<input>` until `$i%10-<input>` and `sum_of_digits-<input>` are falsy; then prints `i`.