Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+2
person also asked this
people also asked this
Replies
15 replies
Answers
4 answers
Subscribers
14 subscribers
Views
6228 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
How do I get Prime numbers 1-100
shilpak0005
over 2 years ago
How do I get prime numbers 1-100 ?
Discussion posts and replies are publicly visible
Top Replies
Stefan Helzle
over 2 years ago
in reply to
GopalK
+1
suggested
Certified Lead Developer
filter( rule!isPrimeNumber(_), enumerate(100)+1, )
Vijayalakshmi Gopalakrishnan
over 2 years ago
in reply to
GopalK
+1
Certified Senior Developer
Hi Shilpa, Try this for prime number rule. rule!isPrimeNumber(_) --> load( local!count: a!forEach( items: enumerate(100) + 1, expression: if(mod(ri!number, fv!item) = 0, fv!item, {}) ), if(count…
Stefan Helzle
over 2 years ago
in reply to
Vijayalakshmi Gopalakrishnan
+1
Certified Lead Developer
The idea is to find the number of number by which the given number can be divided. As the mod() function works with lists, I try the first 100 numbers. The compare operator "=" also works with lists…