g | x | w | all
Bytes Lang Time Link
037Dyalog APL241220T210855ZAaron
021Japt180927T211942ZShaggy
056Perl 6180927T221110Znwellnho
01605AB1E181008T063415ZKevin Cr
074Haskell181006T213224Zumnikos
980APLNARS181006T152824Zuser5898
069JavaScript ES6180927T224314ZArnauld
074Mathematica180928T072125Znumberma
013Jelly180927T220226ZJonathan
069Python 2180928T062800ZChas Bro
015Brachylog v2180928T042751Zais523
065q180927T233624ZThaufeki
092Clean180927T221014ZΟurous
014Husk180927T212251Zბიმო

Dyalog APL, 37 chars

{⍺{≡/{⍵[⍋⍵]}∘⍕¨⍵(÷,×)⍺}⍵+1:⍵+1⋄⍺∇⍵+1}

{⍺ checker ⍵+1:⍵+1 ⋄ ⍺∇⍵+1}  ⍝ Outer function is simple recursion
 ⍺ checker ⍵+1:             ⍝ If `checker` is true,
                            ⍝  return input + 1

 {≡/{⍵[⍋⍵]}∘⍕¨⍵(÷,×)⍺}      ⍝ Inner function verifies:
              ⍵(÷,×)⍺       ⍝ Get a list of right div left and right mult left
             ¨              ⍝ On each of them
           ∘⍕               ⍝     format (turn to string) and
    {⍵[⍋⍵]}                 ⍝     and sort
  ≡/                        ⍝ and see if they are a match

Japt, 24 21 bytes

@[XX*UX/U]ËìnÃäÎd}f°V

Try it

Perl 6, 56 54 bytes

->\x,\y{(y+1...{[eqv] map *.comb.Bag,$_,$_*x,$_/x})+y}

Try it online!

Interesting alternative, computing n*xk for k=-1,0,1:

->\x,\y{first {[eqv] map ($_*x***).comb.Bag,^3-1},y^..*}

05AB1E, 16 bytes

[>©Ð²÷s²*)€{Ë®s#

Try it online. (NOTE: Very inefficient solution, so use inputs close to the result. It works for larger inputs as well locally, but on TIO it'll time out after 60 sec.)

Explanation:

[                   # Start an infinite loop
 >                  #  Increase by 1 (in the first iteration the implicit input is used)
  ©                 #  Store it in the register (without popping)
   Ð                #  Triplicate it
    ²÷              #  Divide it by the second input
      s             #  Swap so the value is at the top of the stack again
       ²*           #  Multiply it by the second input
         )          #  Wrap all the entire stack (all three values) to a list
          €{        #  Sort the digits for each of those lists
             ®s     #  Push the value from the register onto the stack again
            Ë       #  If all three lists are equal:
               #    #   Stop the infinite loop
             

Haskell, 76 74 bytes

Two bytes shaved off thanks to Lynn's comment

import Data.List
s=sort.show
x#y=[n|n<-[y+1..],all(==s n)[s$n*x,s$n/x]]!!0

APL(NARS), 490 chars, 980 bytes

T←{v←⍴⍴⍵⋄v>2:7⋄v=2:6⋄(v=1)∧''≡0↑⍵:4⋄''≡0↑⍵:3⋄v=1:5⋄⍵≢+⍵:8⋄⍵=⌈⍵:2⋄1}
D←{x←{⍵≥1e40:,¯1⋄(40⍴10)⊤⍵}⍵⋄{r←(⍵≠0)⍳1⋄k←⍴⍵⋄r>k:,0⋄(r-1)↓⍵}x}
r←c f w;k;i;z;v;x;y;t;u;o ⍝   w  cxr
   r←¯1⋄→0×⍳(2≠T c)∨2≠T w⋄→0×⍳(c≤1)∨w<0⋄→0×⍳c>3
   r←⌊w÷c⋄→Q×⍳w≤c×r⋄r←r+c
Q: u←D r⋄x←1⊃u⋄y←c×x⋄t←c×y⋄o←↑⍴u⋄→0×⍳o>10⋄→A×⍳∼t>9
M:                     r←10*o⋄⍞←r⋄→Q
A: u←D r⋄→M×⍳x≠1⊃u⋄→B×⍳∼(t∊u)∧y∊u⋄z←r×c⋄v←D z⋄→C×⍳(⍳0)≡v∼⍦u
B: r←r+1⋄→A
C: k←z×c⋄⍞←'x'⋄→B×⍳(⍳0)≢v∼⍦D k
   ⎕←' '⋄r←z

test

  2 f¨250000 290000 3000000
xxxx 
1000000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
10000000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
285714 2589714 20978514 
 3 f¨ 31000000 290000000 
xxxxxxxxx 
100000000xxxxxxxxxxxxxxxxxxxxxxxxxx 
31046895 301046895 

I thought the problem as r a convenient number that can vary so one has the 3 numbers r, r*x, r*x*x in the way r begin to a value that r*x is near y (where x and y are inputs of the problem using same letters as main post). I used the observation that if the first digit of r is d than in r has to appear digits d*x and d*x*x too, for make r (or better r*x) one solution.

JavaScript (ES6), 76 73 69 bytes

Saved 3 bytes by using eval(), as suggested by @ShieruAsakoto

Takes input as (x)(y).

x=>y=>eval("for(;(g=x=>r=[...x+''].sort())(y*x)+g(y/x)!=g(y)+r;)++y")

Try it online!

A recursive version would be 62 bytes, but it's not well suited here because of the high number of required iterations.

How?

The helper function \$g\$ takes an integer as input, converts it to an array of digit characters and sorts this array.

Example:

g(285714) = [ '1', '2', '4', '5', '7', '8' ]

To compare the digits of \$y\times x\$ and those of \$y/x\$ against those of \$y\$, we test whether the concatenation of \$g(y\times x)\$ with \$g(y/x)\$ is equal to the concatenation of \$g(y)\$ with itself.

When adding two arrays together, each of them is implicitly coerced to a comma-separated string. The last digit of the first array is going to be directly concatenated with the first digit of the second array with no comma between them, which makes this format unambiguous.

Example:

g(123) + g(456) = [ '1', '2', '3' ] + [ '4', '5', '6' ] = '1,2,34,5,6'

But:

g(1234) + g(56) = [ '1', '2', '3', '4' ] + [ '5', '6' ] = '1,2,3,45,6'

Commented

x => y =>                   // given x and y
  eval(                     // evaluate as JS code:
    "for(;" +               //   loop:
      "(g = x =>" +         //     g = helper function taking x
        "r =" +             //       the result will be eventually saved in r
          "[...x + '']" +   //       coerce x to a string and split it
          ".sort() + ''" +  //       sort the digits and coerce them back to a string
      ")(y * x) +" +        //     compute g(y * x)
      "g(y / x) !=" +       //     concatenate it with g(y / x)
      "g(y) + r;" +         //     loop while it's not equal to g(y) concatenated with
    ")" +                   //     itself
    "++y"                   //   increment y after each iteration
  )                         // end of eval(); return y

Mathematica, 82 74 bytes

x=Sort@*IntegerDigits;Do[If[x[i#]==x@Floor[i/#]==x@i,Break@i],{i,#2,∞}]&

-8 bytes thanks to tsh

Function that takes arguments as [x,y]. Effectively a brute force search that checks if the sorted list of digits for y,y/x and xy are the same.

Try it online!

Jelly,  14  13 bytes

-1 thanks to Erik the Outgolfer (`` uses make_digits, so D was not required)
+2 fixing a bug (thanks again to Erik the Outgolfer for pointing out the off-by one issue)

×;÷;⁸Ṣ€E
‘ç1#

A full program printing the result (as a dyadic link a list of length 1 is yielded).

Try it online!

How?

×;÷;⁸Ṣ€E - Link 1, checkValidity: n, x               e.g. n=285714,  x=2
×        -     multiply -> n×x                       571428
  ÷      -     divide -> n÷x                         142857
 ;       -     concatenate -> [n×x,n÷x]              [571428,142857]
    ⁸    -     chain's left argument = n             285714
   ;     -     concatenate -> [n×x,n÷x,n]            [571428,142857,285714]
     Ṣ€  -     sort €ach (implicitly make decimals)  [[1,2,4,5,7,8],[1,2,4,5,7,8],[1,2,4,5,7,8]]
        E    -     all equal?                        1

‘ç1# - Main link: y, x
‘    - increment -> y+1
   # - count up from n=y+1 finding the first...
  1  - ...1 match of:
 ç   -   the last link (1) as a dyad i.e. f(n, x)

Note that when the division is not exact the implicit decimal instruction (equivalent to a D) applied prior to the sort yields a fractional part
e.g.: 1800÷3D -> [6,0,0]
while 1801÷3D -> [6.0,0.0,0.33333333333337123]

Python 2, 69 bytes

S=sorted
x,y=input()
while(S(`y`)==S(`y*x`)==S(`y/x`))<1:y+=1
print y

Try it online!

Brachylog v2, 15 bytes

t<.g,?kA/p.∧A×p

Try it online!

Takes input in the form [x,y].

Explanation

t<.g,?kA/p.∧A×p
t                  Tail (extract y from the input)
 <                 Brute-force search for a number > y, such that:
  .                  it's the output to the user (called ".");
   g                 forming it into a list,
    ,?               appending both inputs (to form [.,x,y]),
      k              and removing the last (to form [.,x])
       A             gives a value called A, such that:
        /              first ÷ second element of {A}
         p             is a permutation of
          .            .
           ∧         and
            A×         first × second element of {A}
              p        is a permutation of {.}

Commentary

Brachylog's weakness at reusing multiple values multiple times shows up here; this program is almost all plumbing and very little algorithm.

As such, it might seem more convenient to simply hardcode the value of y (there's a comment on this question hypothesising that 2 is the only possible value). However, there are in fact solutions for y=3, meaning that unfortunately, the plumbing has to handle the value of y as well. The smallest that I'm aware of is the following:

                         315789473684210526
315789473684210526 × 3 = 947368421052631578
315789473684210526 ÷ 3 = 105263157894736842

(The technique I used to find this number isn't fully general, so it's possible that there's a smaller solution using some other approach.)

You're unlikely to verify that with this program, though. Brachylog's p is written in a very general way that doesn't have optimisations for special cases (such as the case where both the input and output are already known, meaning that you can do the verification in O(n log n) via sorting, rather than the O(n!) for the brute-force approach that I suspect it's using). As a consequence, it takes a very long time to verify that 105263157894736842 is a permutation of 315789473684210526 (I've been leaving it running for several minutes now with no obvious progress).

(EDIT: I checked the Brachylog source for the reason. It turns out that if you use p on two known integers, the algorithm used generates all possible permutations of the integer in question until it finds one that's equal to the output integer, as the algorithm is "input → indigits, permute indigits → outdigits, outdigits → output". A more efficient algorithm would be to set up the outdigits/output relationship first, so that the backtracking within the permutation could take into account which digits were available.)

q, 65 bytes

{f:{asc 10 vs x};while[not((f y)~f y*x)&(f y*x)~f"i"$y%x;y+:1];y}

Split number on base 10, sort each ascending, and check if equal. If not, increment y and go again

Clean, 92 bytes

import StdEnv
$n m=hd[i\\i<-[m..],[_]<-[removeDup[sort[c\\c<-:toString j]\\j<-[i,i/n,i*n]]]]

Try it online!

Pretty simple. Explanation coming in a while.

Husk, 14 bytes

ḟ§¤=OoDd§¤+d*/

Try it online!

Explanation

ḟ§¤=O(Dd)§¤+d*/  -- example inputs: x=2  y=1
ḟ                -- find first value greater than y where the following is true (example on 285714)
 §               -- | fork
         §       -- | | fork
              /  -- | | | divide by x: 142857
                 -- | | and
             *   -- | | | multiply by y: 571428
                 -- | | then do the following with 142857 and 571428
                 -- | | | concatenate but first take
           +     -- | | | | digits: [1,4,2,8,5,7] [5,7,1,4,2,8]
          ¤ d    -- | | | : [1,4,2,8,5,7,5,7,1,4,2,8]
                 -- | and
       d         -- | | digits: [2,8,5,7,1,4]
      D          -- | | double: [2,8,5,7,1,4,2,8,5,7,1,4]
                 -- | then do the following with [2,8,5,7,1,4,2,8,5,7,1,4] and [1,4,2,8,5,7,5,7,1,4,2,8]
   =             -- | | are they equal
  ¤ O            -- | | | when sorted: [1,1,2,2,4,4,5,5,7,7,8,8] [1,1,2,2,4,4,5,5,7,7,8,8]
                 -- | : truthy
                 -- : 285714