Fun
Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

Prime numbers up to 100

Poll - Total Votes: 16
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
91
97
Show Results
You can only vote on one answer.
Which isn't one?
This page is a permanent link to the reply below and its nested replies. See all post replies »
SW-User
All of them are prime numbers. When a number is only divisible by itself and 1, it’s called a prime number. They don’t have any other divisors.
Classified · M
@SW-User There is one sneaky number in that list which looks very much like prime number, but isn't, because it is divisible by more than 1 and itself.
SW-User
@Classified yikes, yes it’s 91. 7 and 13. I wrote an algorithm though instead of eyeballing every number.
Classified · M
@SW-User Bonus points for writing an algorithm though. 😋
You could also check a list online. 🤔
SW-User
@Classified You definitely can, but I customized the algorithm that drives the online prime check engine :D. I like to solve problems.

Here's the code and here's the output.

[image deleted]
[image deleted]
Classified · M
@SW-User Which language is that?
SW-User
@Classified Python. It's fast, effective and easy to learn. I'm not a programmer but I do fair bit of programming so that the consulting IT firms don't scam me and ask me for 100k for writing 10 lines of code. LOL
Classified · M
@SW-User My colleague use it too, but for my part of the job we use a different data program.
SW-User
@Classified You can use python to d any kind of data manipulation, it requires some programming skills, but for people who don't want to write code, there are some utilities like excel also has macros to find out what you want.

=IF(B4=2,"Prime",IF(AND(MOD(B4,ROW(OFFSET($A$2,,,ROUNDUP(SQRT(B4),0)-1)))<>0),"Prime","Not Prime"))
Classified · M
@SW-User Usually I don't program in Excel, but it has some uses. 🤔
SW-User
@Classified It does have uses, but I'm not a fam of excel or anything than Microsoft makes to do tech work. They have their own monopoly over how they want you to do things.
Classified · M
@SW-User I don't know much outside of Microsoft, though Linux should be a good alternative. 🤔
SW-User
@Classified It's a perfect alternative.
Classified · M
@SW-User Is it easy?
SW-User
@Classified Once you get a hang of it, it shouldn't be a problem. You'll enjoy it.
Classified · M
@SW-User Maybe I should try once. I have a colleague who uses it too.