Properties
Category
Uncategorized
Similar Topics
Statistics
Comments
2
Participants
3
Subscribers
27
Votes
1
Views
419
Share
multiply numbers if they meet a condition...
Answered
if i have a list of numbers b through o, and a boolean identifier checks if they are prime or not. (called bprime, through oprime).
How can I multiply the number b through o, but only if they are prime?
Would i use an if statement...
if(bprime, b*if(cprime, ..... ? I can't seem to get this to work if this is the correct approach.
 GeoGebra
 Help
 Partners

Contact us
 Feedback & Questions
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 +43 677 6137 2693
© 2020 International GeoGebra Institute
Maybe you you could use the command KeepIf() in combination witth IsPrime to create a list with only the primes of the initial numbers; KeepIf(IsPrime(n), n, list)Then you can mulpiply elements as you want.
or if(isprime(b),b,1)*if(isprime(o),o,1)
Comments have been locked on this page!