Welcome Guest ( Log In  Register ) Search 
DroopyPawn 
Posted: Jan 23 2007, 02:37 AM


How can I set a condition so that my number x has no factors that are perfect squares?

Support QA 
Posted: Jan 24 2007, 10:35 AM


Please see attached bank for an example.
Attached File ( Number of downloads: 2143 ) No_Squared_Factors.bnk 

DroopyPawn 
Posted: Jan 24 2007, 09:20 PM


Ok. Your example will work if I need to create a number with no perfect square factors but it doesn't answer my question.
My problem generates a number as a function of other variables. But I don't know beforehand what the generated value will be. I need to check whether or not my generated value has perfect square factors. I tried a condition like... isrelprime(x,4) and isrelprime(x,9) and isrelprime(x,16) and isrelprime(x,25) etc up to my maximum expected value. Couldn't get it to work though. Any other ideas? 
Support DC 
Posted: Oct 8 2007, 01:23 PM


Can you try working backwards? In other words, try creating the number so that it will have only prime factors.

gbc65 
Posted: Oct 17 2007, 06:36 PM


"I tried a condition like... isrelprime(x,4) and isrelprime(x,9) and isrelprime(x,16) and isrelprime(x,25) etc up to my maximum expected value. Couldn't get it to work though." would it work if your condition was isrelprime(x,4) OR isrelprime(x,9) OR isrelprime(x,16) OR isrelprime(x,25) etc ? 
Support DC 
Posted: Oct 19 2007, 08:39 AM


Try using this:
Question: Is var1 relatively prime? Answer: correct Definitions: var1 range(4,16) correct if((var1 MOD 4)=0,"Contains factor",if((var1 MOD 9)=0,"Contains factor",if((var1 MOD 16)=0,"Contains factor","Relatively Prime"))) 