I have a number machine.
I say x gives y if when x goes in, y comes out.
For any numbers x and y, by "xy" I mean x followed by y.
Here are my two rules.

1x gives x.

For example, 13 gives 3.

If x gives y, then 2x gives yy.

For example, 213 gives 33 since 13 gives 3.

What is a number that gives itself?

(In reply to

answer by K Sengupta)

By the given conditions, the number of digits of the input number must exceed 1. Now, the # digits in the input number cannot be 2 or 3, since that would result in a mismatch between the number of digits of the input number and output number. Thus, the number of digits in the input number must be at least 4.

If the number of digits in the input number is 4, then the input number must be of the form 21xy. Since 1xy gives xy in terms of rule (i), it follows that 21xy must give xyxy in terms of rule (ii).

Since by the given conditions, the input number must equal the output number, we must have 21xy = xyxy, so that : (x,y) = (2, 1), giving the required number as 2121.

*** Full compliments to the author for framing this interesting puzzle.

*Edited on ***September 26, 2009, 12:58 pm**