Skip to main content
Commonmark migration
Source Link

#PHP, 73+1 bytes

PHP, 73+1 bytes

while(array_sum(str_split($i+=$n=$argn))-$n|$i%10**strlen($n)-$n);echo$i;

Run as pipe with -R.

loops $i through multiples of <input> until sum_of_digits-<input> and tail_of_i-$n are falsy; then prints i.

#PHP, 73+1 bytes

while(array_sum(str_split($i+=$n=$argn))-$n|$i%10**strlen($n)-$n);echo$i;

Run as pipe with -R.

loops $i through multiples of <input> until sum_of_digits-<input> and tail_of_i-$n are falsy; then prints i.

PHP, 73+1 bytes

while(array_sum(str_split($i+=$n=$argn))-$n|$i%10**strlen($n)-$n);echo$i;

Run as pipe with -R.

loops $i through multiples of <input> until sum_of_digits-<input> and tail_of_i-$n are falsy; then prints i.

Post Undeleted by Titus
fixed: input is not a single digit!
Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 63+173+1 bytes

while(array_sum(str_split($i+=$n=$argn)%10)-$n|array_sum(str_split$n|$i%10**strlen($i)$n)-$n);echo$i;

Run as pipe with -R.

loops $i through multiples of <input> until $i%10sum_of_digits-<input> and sum_of_digitstail_of_i-<input>$n are falsy; then prints i.

#PHP, 63+1 bytes

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.

#PHP, 73+1 bytes

while(array_sum(str_split($i+=$n=$argn))-$n|$i%10**strlen($n)-$n);echo$i;

Run as pipe with -R.

loops $i through multiples of <input> until sum_of_digits-<input> and tail_of_i-$n are falsy; then prints i.

Post Deleted by Titus
Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 63+1 bytes

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.