← RoseCode

ROSECODE 385

A mysterious machine

Philippe_57721 · Math ·

Given a string representing a positive integer, the machine outputs another string using the following rules:
Rule 1 : If the input is 2X, the output will be X.
E.g: M(234) => 34
Rule 2 : If the input is 3X and M(X) = Y the output will be Y2Y.
E.g: M(327) = 727

Find X such as M(X) = X
Find Y such as M(Y) = Y2Y
Find Z such as M(Z) = 7Z

Answer format: X,Y,Z

[My timing: pencil and paper]