Forum Rules Notice

Due to inappropriate SPAM postings, our forums are now being monitored for inappropriate content. This will cause your post to not appear publicly until it has been approved by a forum moderator. We apologize for the delay this may cause in your response, but have found it the best way to control inappropriate posts.


  Reply to this topicStart new topicStart Poll

> Perfect Square Factors
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?
PMEmail PosterUsers Website
Top
Support QA
Posted: Jan 24 2007, 10:35 AM




Please see attached bank for an example.

Attached File ( Number of downloads: 2143 )
Attached File  No_Squared_Factors.bnk
Top
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?
PMEmail PosterUsers Website
Top
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.
PMEmail Poster
Top
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 ?
PMEmail Poster
Top
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")))
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Reply to this topic Start new topicStart Poll

 


Copyright 1998-2008 eInstruction Corp. All rights reserved.