Question: For and If loop

November 21 2012 Babak 50

Assume; we have a set of elements like A:={2, 3, 6,24,7,5,25,100,124,32,...} with #A=20 and moreover, we know that some of these elements satisfy an equation, for example a^k=b^2 for some positive integers k ( a  and b are in A).

For example if a=2 be in A and b=64 be also in A, then k=6. I have written some loops including for and if, but I have exhausted. I see, I can’t arrange and link these functions together properly.

May I ask someone hint me, how maple can help me find the values of k for example in a finite range [1..10] satisfying the relation above?

Please Wait...