The answer is 2261, isn't it?

Logic Level 2

I am thinking of a 3 digit natural number. Its first digit x x is neither a prime number and nor a square number.

The difference between the number and 100 x 100x is cube of a natural number .

If 100 is subtracted from the number it becomes a palindrome. Find the number.

Details and Assumptions :

  • Please don't get mislead by the title, though answer can be expressed as 2261.


The answer is 827.

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

Vaibhav Prasad
Mar 29, 2015

Since x x is neither a prime number nor a perfect square, we can have only 6 6 or 8 8 as the first digit.

The difference between the number and 100 x 100x would obviously be a 2 2 -digit number. There are 4 4 perfect cubes under 100 1 , 8 , 27 , 64 100 - 1, 8, 27, 64

So we have the following numbers :

601 , 608 , 627 , 664 801 , 808 , 827 , 864 601, 608, 627, 664 \\ 801, 808, 827, 864

Now, the 3 r d 3^{rd} condition is followed by only one number, 827 \boxed {827} , and were DONE \text{DONE} !

Upvote it if you liked it

why can the answer be expressed as 2261?

Lawrence Mayne - 6 years, 2 months ago

Log in to reply

827 in base 7 is 2261

Nicholas Stearns - 6 years, 2 months ago

Log in to reply

Wow. How could you have possibly noticed that?

Brock Brown - 6 years, 2 months ago

Log in to reply

@Brock Brown Haha. Well, when you say that a number can be expressed as some other number, bases are kind of implied. The rest is simple calculation.

Nicholas Stearns - 6 years, 2 months ago

Haha thanks, somehow I missed out base7 whilst going through bases

Lawrence Mayne - 6 years, 2 months ago
Brock Brown
Mar 30, 2015

Python 2.7:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# non-prime and
# non-square digits
possible_x = [6,8]
def cube(n):
    test = 0
    while test**3 <= n:
        if test**3 == n:
            return True
        test += 1
    return False
def palindrome(n):
    return str(n) == str(n)[::-1]
def goal(guess):
    x = int(str(guess)[0])
    if x not in possible_x:
        return False
    if not cube(abs(guess-100*x)):
        return False
    if palindrome(guess-100):
        return True
for guess in xrange(100,1000):
    if goal(guess):
        print "Answer:", guess

Hats off !! To your programming skills . You could just solve any question using it How many other computer languages do you know ? @Brock Brown

A Former Brilliant Member - 6 years, 2 months ago

Log in to reply

Thanks. :)

I know a little C, C++, Java, JavaScript, Visual Basic, ActionScript, Sage, but Python is by far my favorite. Its readability allows you to focus on designing algorithms instead of needing to focus on kaboobly doo .

Brock Brown - 6 years, 2 months ago

Log in to reply

I know a little(just some basics) of visual basic but have been never able to solve questions using it (except maths' basic fundamental operation). Try my question ; love to see your approach and give some feedback too.

A Former Brilliant Member - 6 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...