Skip to main content
added 565 characters in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 79 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Tr[1^s]==1&]

Try it online! with a lower number because it is very slow

here is another approach that constructs all the numbers in 1sec

#Mathematica, 123 bytes

Union[FromDigits/@(F=Flatten)[Table[Partition[#,i,1],{i,2,9}]&/@Select[F[Table[Range[j,9,k],{j,9},{k,9}],1],Tr[1^#]>1&],2]]   

Try it online! all numbers in a sec

#Mathematica, 79 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Tr[1^s]==1&]

Try it online! with a lower number

#Mathematica, 79 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Tr[1^s]==1&]

Try it online! with a lower number because it is very slow

here is another approach that constructs all the numbers in 1sec

#Mathematica, 123 bytes

Union[FromDigits/@(F=Flatten)[Table[Partition[#,i,1],{i,2,9}]&/@Select[F[Table[Range[j,9,k],{j,9},{k,9}],1],Tr[1^#]>1&],2]]   

Try it online! all numbers in a sec
deleted 1 character in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 8079 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Length@s==1&]Min[s=Union@Differences@IntegerDigits@#]>0&&Tr[1^s]==1&]

Try it online!Try it online! with a lower number

#Mathematica, 80 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Length@s==1&]

Try it online! with a lower number

#Mathematica, 79 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Tr[1^s]==1&]

Try it online! with a lower number

Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 80 bytes

Select[Range@123456789,Min[s=Union@Differences@IntegerDigits@#]>0&&Length@s==1&]

Try it online! with a lower number