What is the smallest integer higher than 1 such the \$frac12\$ of it is a perfect square and also \$frac15\$ of it is a perfect fifth power?

I have tried multiplying every perfect square (up come 400 by two and also checking if that is a perfect 5th power, however still nothing. Ns don"t recognize what to do at this point.

You are watching: What is the smallest integer greater than 58

The number is clearly a lot of of \$5\$ and \$2\$. Us look because that the smallest, so us assume the it has actually no an ext prime factors.

So permit \$n=2^a5^b\$. Since \$n/2\$ is a square, climate \$a-1\$ and \$b\$ space even. Because \$n/5\$ is a 5th power, \$a\$ and \$b-1\$ space multiples the \$5\$. Climate \$a=5\$ and \$b=6\$.

Here"s a an extremely unsophisticated approach: permit \$n\$ it is in the smallest such integer. Climate there exist integers \$a\$ and also \$b\$ such that \$n=5a^5\$ and also \$n=2b^2\$. It complies with that \$a\$ is a lot of of \$2\$, to speak \$a=2a_1\$, and also \$b\$ is a multiple of \$5\$, to speak \$b=5b_1\$. Then\$\$n=2^5cdot5cdot a_1^5qquad ext and qquad n=2cdot5^2cdot b_1^2.\$\$This consequently shows that \$a_1\$ is a multiple of \$5\$, speak \$a_1=5a_2\$, and \$b_1\$ is a many of \$2\$, say \$b_1=2b_2\$. Then\$\$n=2^5cdot5^6cdot a_2^5qquad ext and qquad n=2^3cdot5^2cdot b_2^2.\$\$This subsequently shows that \$b_2\$ is a many of both \$2\$ and \$5^2\$, to speak \$b_2=2cdot5^2cdot b_3\$. Then \$\$n=2^5cdot5^6cdot a_2^5qquad ext and qquad n=2^5cdot5^6cdot b_3^2.\$\$This reflects that \$ngeq2^5cdot5^6\$, and as you could expect a quick examine shows the \$n=2^5cdot5^6\$ does without doubt work, therefore \$n=2^5cdot5^6=500000\$.

re-superstructure
point out
monitor
edited Nov 27 "19 at 11:44

YiFan
answered Oct 29 "18 in ~ 14:31

ServaesServaes
\$endgroup\$
1
15
\$egingroup\$
This is favor code golf...

The price is 500000.

Proof by computation: (in R)

share
point out
monitor
answer Oct 30 "18 at 1:49
user385133user385133
\$endgroup\$
3
18
\$egingroup\$ But... The OP didn't ask how to (in general) find the answer. Lock asked what the price was, presumably through the minimal proof required to verify it. Ns joked around code golf because I do the efforts to provide the shortest, most transparent possible demonstration that the an outcome was correct. \$endgroup\$
–user385133
Oct 30 "18 in ~ 7:06

include a comment |
9
\$egingroup\$
I am composing this answer since you stated that you were trying a guess and check method. Computers are an excellent at this. A kind algorithm is to have two integers \$n_x\$ and \$n_y\$ which start at 1. Then, calculate x by act \$2n_x^2\$ and y by act \$5n_y^5\$. Examine if they are equal; if lock are, you discovered your answer. If not, whichever that \$x\$ and also \$y\$ are lower, increment the \$n\$ value (i.e., if \$x , then increment \$n_x\$). Recalculate \$x\$ and \$y\$ and repeat till they room the same.

Here is an example implementation in Python making use of generators:

class SpecialSquareGenerator: def __init__(self, n=0): self.n = n def __iter__(self): return me def __next__(self): self.n += 1 return self.n, 2*(self.n**2)class SpecialFifthGenerator: def __init__(self, n=0): self.n = n def __iter__(self): return self def __next__(self): self.n += 1 return self.n, 5*(self.n**5)def special_square(): n = 0; ss = SpecialSquareGenerator() sf = SpecialFifthGenerator() nx, x = next(ss) ny, y = next(sf) print("0: 1 2: 3".format(nx, x, ny, y)) if True: if (x == y): return x if x to run it returns the right answer:

gns-mac1:sandbox gns\$ python3 special_square.py 1: 2 1: 52: 8 1: 52: 8 2: 1603: 18 2: 160...(output omitted)494: 488072 10: 500000495: 490050 10: 500000496: 492032 10: 500000497: 494018 10: 500000498: 496008 10: 500000499: 498002 10: 500000500: 500000 10: 500000500000Of course, the charline-picon.comematical method is much better for knowledge the problem. Yet if you have to guess and also check, then computers are the tool for that.

P.S.

There is another way to exhaustively search for the solution. You deserve to take sequential number and try dividing them by 2 (or 5) and also then taking the square root (or 5th root) and also then check if that result is an integer because that both operations. There are two downsides come this approach:

You have to decide if a floating allude number is an alleged to stand for an integer. This is tough for computers and language implementations come do due to the fact that computers only have a fixed set of number to represent floating suggest numbers.The search space is higher (by stimulate of \$n^2\$). So that method that you should expect come take much longer to reach the very same answer, offered the same hardware.

There are quicker ways come implement both mine algorithm, and also the other I stated in the postscript. Because that example, girlfriend can double \$n\$ each time and then once you overshoot, use binary find in the room between the critical \$n\$ and also the one the overshot.