Sum of Powers is Perfect Square

Q Q , X X , Y Y and Z Z are 4 4 positive integers where:

Q = 3 X + 5 Y + 7 Z Q={ 3 }^{ X }+{ 5 }^{ Y }+{ 7 }^{ Z }

Q Q is a perfect square. Find X + Y + Z X+Y+Z , and Q Q is the minimum possible perfect square in the sum above.


The answer is 6.

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

Rohan Jain
Jul 4, 2014

It is clear that Q is odd, which means its square root would also be odd

lets look at some possible candidates for sqrt(Q)

clearly,
1,2,3,4 are rejected as minimum value of Q is 15

6,8 cannot be the solution (they are even)

5 and 7 would also be impossible (trial and error)

for 9 which means Q=81, put X=3, Y=1, Z=2

P.S. I know this is not a very good method, if anyone has got a different approach please let me know

for x in range(1,10): ... for y in range(1,10): ... for z in range(1,10): ... q =3 x+5 y+7 z ... v = int(q 0.5) ... if v*v==q: print "{0} {1} {2}".format(x,y,z)

Alei Reyes - 6 years, 11 months ago

Using the unit digit logic, we can rule out all possibilities....The possible unit digits come out to be 9,5 and 1. That leaves a simple casework.

Pankaj Joshi - 6 years, 11 months ago

Interesting... I got X=2,Y=2, Z=2 with the same answer.

Ariel Gershon - 6 years, 10 months ago

Log in to reply

Sure? Silly mistake. Your solution gives 83, which isn't perfect square.

Sudip Maji - 6 years, 10 months ago

X=0,Y=0,Z=1 thn Q is 9,a perfect square ....bt ans is deffrent

PAPAN PAL - 6 years, 11 months ago

Log in to reply

All the integers are positive.0 is not positive.

Adarsh Kumar - 6 years, 11 months ago

Its natural no. 0 is whole no.

Abhishek Dadhich - 6 years, 11 months ago

Bro read qes carefully x y nd z all are non zero

Diwakar Mishra - 6 years, 11 months ago
Josh Speckman
Jul 28, 2014

import math

sat=[]
ints=[]

def frac(n):
  return 1.0*(n-int(n))

for i in range(1, 10):
  for j in range(1, 10):
    for k in range(1, 10):
      x=3**i + 5**j + 7**k
      if frac(math.sqrt(x*1.0))==0:
        sat.append(x)
        ints.append(i+j+k)

print str(ints[sat.index(min(sat))])

Simpler version: for x in range(1,10): for y in range(1,10): for z in range(1,10): q = pow(3,x)+pow(5,y)+pow(7,z) q 1 = math.sqrt(q) if int(q 1)==q_1: print(x+y+z)

David Monk - 6 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...