Git Product home page Git Product logo

primenumbers's Introduction

PrimeNumbers

Repository containing code that aims to find prime numbers and displays a list of them available on the web.

The idea of ​​the repository is to create the most optimized code possible, to generate increasingly larger prime numbers and add them to the primes.txt list

List of prime numbers

https://github.com/gabriel-logan/PrimeNumbers/blob/main/docs/primes.txt

Raw file

https://raw.githubusercontent.com/gabriel-logan/PrimeNumbers/main/docs/primes.txt

Small List of prime numbers (first 1000)

https://github.com/gabriel-logan/PrimeNumbers/blob/main/docs/small-primes-list.txt

Small List of prime numbers (first 1000) Raw file

https://raw.githubusercontent.com/gabriel-logan/PrimeNumbers/main/docs/small-primes-list.txt

You can also check if a number is prime using

gcc ./checkPrimes.c -o checkPrimes

./checkPrimes
user@user$ time ./checkPrimes
Enter a number: 1779999803
1779999803 is a prime number.

real    0m0.945s
user    0m0.001s
sys     0m0.000s
user@user$

How each code works

addToFile.c

This code is responsible for adding a number to the primes.txt file.

checkMultiPrimes.c

This code is responsible for checking if a interval of numbers is prime. And if it is, print it on the screen.

checkPrimes.c

This code is responsible for checking if a number is prime. And if it is, print it on the screen.

createFile.c

This code is responsible for creating the primes.txt file. It will erase the file if it already exists.

createFileWithLimit.c

This code is responsible for creating the primes.txt file. It will erase the file if it already exists. It will also create a file with a limit of numbers. Example: if you want to create a file with the first 1000 prime numbers, you can use this code.

checkPrimesWithThreads.c

This code is responsible for generating and printing prime numbers on the screen.

genAndPrint.c

This code is responsible for generating and printing prime numbers on the screen.

primenumbers's People

Contributors

gabriel-logan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

lyubomirt

primenumbers's Issues

Improve the code

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.