Think Like a Machine!

Level pending

How many positive integers less than 1 000 000 become bigger when their digits are reversed?


The answer is 449001.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Alex Zhong
Apr 10, 2015

python program

def reverse_int(n):

    return int(str(n)[::-1])

i = 0

  for n in range(1,1000000):

      if reverse_int(n) > n:

          i=i+1

print (i)

How are 1 digit numbers reversed (along with 2,3,4 and 5 digit numbers)? i.e. would 000 001 \rightarrow 100 000 or would we have 1 \rightarrow 1 because I was thinking of using group theory to think of the digits being reversed as a functions of at most order 2 ( f 2 ( x ) = x f^{2} (x) = x ) . i.e. 1 = 000 001 \rightarrow 100 000 \rightarrow 000 001

Curtis Clement - 6 years, 2 months ago

Log in to reply

I think it is 1 1 1 \rightarrow 1 .

Alex Zhong - 6 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...