5-Digit again

Find the 5 digit numbers satisfying the following condition and find the sum.

The number obtained by replacing the last digit by 1 is 3 times bigger than the number obtained by replacing the first digit by 1.


The answer is 104994.

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.

2 solutions

Brock Brown
Jan 8, 2015

The only two valid numbers are 44997 and 59997.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
def goal(x):
    s = str(x)
    if int(s[0:4]+'1') == 3*int('1'+s[1:5]):
        return True
    return False
total = 0
for i in xrange(10000,100000):
    if goal(i):
        total += i
print "Answer:", total

Nidhin Basheer
Jan 8, 2015

Let 'abcde' be the 5 digit number. 1bcde and abcd1 are the numbers obtained by replacing first and last digit respectively. We have abcd1=3x(1bcde)

10000a + 1000b + 100c + 10d +1 = 3( 10000 +1000b + 100c +10d +e)

2000b + 200c +20d =10000a -30000 +1 -3e

20( 100b + 10c + d ) =10000(a-3) - (3e-1)

100b+ 10c +d = 500(a-3) - (3e-1)/20

bcd = 500(a-3) -(3e-1)/20

Where bcd is a 3digit positive integer. Since 500(a-3) is an integer, (3e-1)/20 should be an integer. That gives e=7.

so bcd=500(a-3)-1

for bcd to be positive, a>3.

put a=4 bcd=499 put a=5 bcd=999

for all the other values of 'a', bcd is not a 3 digit number.

So the five digit numbers are 44997 and 59997 and the sum is 104994

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...