Skip to main content
added 623 characters in body
Source Link
Galen Ivanov
  • 21.5k
  • 3
  • 26
  • 62

Icon, 50 bytes

procedure f(n) i:=seq(n,n)&0=*(i--10) return i end 

Try it online!

seq(n,n) generates an "infinite" (seq operator doesn’t work with large integers) sequence starting at n with step n

&is conjunction - Icon evaluates the next expression and if it fails, than backtracks to the expression to its left - so generates the next integer.

i--10 finds the difference of the string representation of i with the string 10 - Icon automatically casts number to strings when an operation on strings is used.

*(1--10) finds the length of the difference of i and 10 (which is a string)

0=*(1--10) - if the length is 0, the number is composed only of 1's and 0's.

Icon, 50 bytes

procedure f(n) i:=seq(n,n)&0=*(i--10) return i end 

Try it online!

Icon, 50 bytes

procedure f(n) i:=seq(n,n)&0=*(i--10) return i end 

Try it online!

seq(n,n) generates an "infinite" (seq operator doesn’t work with large integers) sequence starting at n with step n

&is conjunction - Icon evaluates the next expression and if it fails, than backtracks to the expression to its left - so generates the next integer.

i--10 finds the difference of the string representation of i with the string 10 - Icon automatically casts number to strings when an operation on strings is used.

*(1--10) finds the length of the difference of i and 10 (which is a string)

0=*(1--10) - if the length is 0, the number is composed only of 1's and 0's.

Source Link
Galen Ivanov
  • 21.5k
  • 3
  • 26
  • 62

Icon, 50 bytes

procedure f(n) i:=seq(n,n)&0=*(i--10) return i end 

Try it online!