/programming-challenge-primenumbers

Finding prime numbers using different programing languages

Primary LanguageJavaMIT LicenseMIT

Programming challenge: Generating Prime numbers

This is a collection, of different implementations using various programing langauges, for finding prime numbers.

One of the first challenges I give myself, when I learn a new programming language, is try to implement a prime numbers generator. I think this challenges is good way to learn some of the basics of any new programming language. You learn how to use variables, loops, if statements, and function calls/declaration. Which is really the core components of any programming language.

But it doesn't stop there. What if you would like to generate an array of prime numbers? Or want an interactive prompt, to see if a given number is a prime number? Then you get to learn even more aspects of a programming langauge, like arrays and input.

And if you want to go crazy, you could try to figure out how to multithread this task.

So I believe this is a fun and challenging way to learn a new programming language. You can start small, with the basics. But go further into advanced topics, as you advance.

My approach to finding prime numbers is the simple brute force method. It simple consists of checkin if any number is divisable in a given number. I know there are better algorithms out there, but for this is not about using the best algorithm out there, it's all about learning programing languages. That means in this repository, where I save my implementations, you cannot find the best and most efficient ways to find prime numbers. When that is said, do try to make some performance improvents in my implementations.