Find a four-digit number such that it equals to the third power of the sum of all of its integers
I guess not hit and trial method??
prof!!!!!
This like the problem posted by @Callisto It gas two solutions.
has not gas
4913 is one
5832 is the other
Yes
I think the third power and the fourth power are the only cases that have solutions.
Dr, are you going to explain the way of doing it in a more.....'mathematical' way?
The only two numbers are 4913,5832 The solution in AutoIt For $i=1000 to 9999 $data = StringSplit ($i, "") $data = $data [1] + $data [2] + $data [3] + $data [4] $data = $data * $data*$data If $data = $i Then $file=FileOpen ("test1.txt", 1) FileWriteLine ($file, $data) EndIf Next
In[171]:= Clear[x, y, z, w] n = 9; U = {}; For[ w = 1, w <= n, w++, For[ x = 0, x <= n, x++, For[ y = 0, y <= n, y++, For[ z = 0, z <= n, z++, If[1000 w + x + 10 y + 100 z == (w + x + y + z)^3, U = Append[U, {w, z, y, x}]]]]]] U Out[175]= {{4, 9, 1, 3}, {5, 8, 3, 2}}
I will think of a mathematical way to do it. I do not know if there is one.
programming solution .. :D
i was thinking the same way .. :D i bet nbouscal is better programmer than me :D
Haha probably not I am a very hacky programmer
we are not even allowed to use calculator when doing this type of questions. Let alone programming! (even though I know nothing about programming...) Thanks doc :)
For this one I just used guess-and-check anyway, no programming
Join our real-time social learning platform and learn together with your friends!