{"id":23105382,"url":"https://github.com/zentrocdot/prime-numbers","last_synced_at":"2026-04-30T10:32:56.330Z","repository":{"id":226586325,"uuid":"768643019","full_name":"zentrocdot/prime-numbers","owner":"zentrocdot","description":"Calculation of Prime Number s using bash","archived":false,"fork":false,"pushed_at":"2024-03-10T08:37:54.000Z","size":181,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T10:14:10.606Z","etag":null,"topics":["bash","composite-number","composite-numbers","natural-number","prime-number","prime-numbers","python","sieve","sieve-of-eratosthenes"],"latest_commit_sha":null,"homepage":"https://launchpad.net/~zentrocdot/+archive/ubuntu/prime-numbers/+packages","language":"Euphoria","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zentrocdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"custom":"https://www.buymeacoffee.com/zentrocdot"}},"created_at":"2024-03-07T13:18:42.000Z","updated_at":"2024-03-08T16:30:26.000Z","dependencies_parsed_at":"2024-03-08T12:24:54.918Z","dependency_job_id":"3351898c-99b2-484e-a701-266bd67129f4","html_url":"https://github.com/zentrocdot/prime-numbers","commit_stats":null,"previous_names":["zentrocdot/prime-numbers"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentrocdot%2Fprime-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentrocdot%2Fprime-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentrocdot%2Fprime-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentrocdot%2Fprime-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zentrocdot","download_url":"https://codeload.github.com/zentrocdot/prime-numbers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247086840,"owners_count":20881272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","composite-number","composite-numbers","natural-number","prime-number","prime-numbers","python","sieve","sieve-of-eratosthenes"],"created_at":"2024-12-17T00:50:22.478Z","updated_at":"2026-04-30T10:32:56.295Z","avatar_url":"https://github.com/zentrocdot.png","language":"Euphoria","funding_links":["https://www.buymeacoffee.com/zentrocdot"],"categories":[],"sub_categories":[],"readme":"# README\n\n\u003cp align=\"justify\"\u003eThe program prints the prime numbers in a given range from 0 to n. The number separator in the output is a simple space.\u003c/p\u003e\n\n## Motivation\n\n\u003cp align=\"justify\"\u003eMotivation was to writing a simple program for calculating prime numbers which are printed in one line without a trailing line break. The program is intended to work as simple generator of prime numbers for other scripts. For prime numbers less than 100000 the underlying algorithms is fast enough.\u003c/p\u003e\n\n## Pseudo Code\n\n\u003cp align=\"justify\"\u003eUnderlying algorithm as pseudo code\u003c/p\u003e\n\n    Data: Integer number n\n    Output: Prime numbers smaller than n\n    Function: prime_numbers\n        A ← array of size n with boolean values set to true\n        for i ← 2 to √n do\n            if A[i] is true then\n                j ← i * i\n                while j ≤ n do\n                    A[j] ← false\n                    j ← j + 1\n                end\n            end\n        end    \n        return array with prime numbers and composite numbers\n    end\n    \n## Output format\n\n\u003cp align=\"justify\"\u003eA simple call looks like:\u003c/p\u003e\n\n    hades@hades:~$ prime_numbers\n    hades@hades:~$ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97hades@hades:~$\n\n\u003cp align=\"justify\"\u003eWithout given boundary prime_numbers print the primes in a range of 0 to 100.\u003c/p\u003e   \n\n\u003cp align=\"justify\"\u003eA call with a boundary looks like:\u003c/p\u003e\n\n    hades@hades:~$ prime_numbers 1000\n    hades@hades:~$2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 \n    109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239\n    241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 \n    389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 \n    547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 \n    691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 \n    859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997hades@hades:~$ \n\n\u003cp align=\"justify\"\u003eThe prime numbers in a range of 0 to 1000 are printed without line break.\u003c/p\u003e\n\n## Outstanding issues\n\n\u003cp align=\"justify\"\u003eWriting this program I had in mind to compare the results from Bash with other programming languages like Python and C/C++. Open issue is the question how the memory managment can be optimised. It is also of interest how the calculation time can be reduced by change of the programming language and by modifying the code.\u003c/p\u003e\n\n## To-Do\n\n\u003cp align=\"justify\"\u003eThe range of calculated prime numbers should be variable in the future. It should also be possible to get prime numbers or composite numbers. It should also be possible to consecutive prime numbers. And the program should be able to print the number of counted prime numbers or composite numbers. The package needs also a function if a number is a prime number or a composite number.\u003c/p\u003e\n\n## Other Prime Number Programs\n\n\u003cp align=\"justify\"\u003eI found so far two over Ubuntu installable programs with which prime numbers can be calculated [1,2].\u003c/p\u003e\n    \n## References\n\n[1]    manpages.ubuntu.com/manpages/noble/en/man1/primesieve.1.html\n\n[2]    manpages.ubuntu.com/manpages/noble/man1/matho-primes.1.html\n\n## See also\n\n[GT]    github.com/guidotheelen/prime_numbers/blob/master/lib/prime_numbers.dart\n\n[RM]    rimonmostafiz.github.io/blog/sieve-of-eratosthenes-memory-efficient-implementation/\n\n[BG]    www\u0026#8203;.baeldung.com/cs/prime-number-algorithms\n\n\u003chr width=\"100%\" size=\"1\"\u003e\n\n\u003cp align=\"center\"\u003e\nIt would be grateful if you decide to support the work here.\n\u003c/p\u003e\n\n\u003chr width=\"100%\" size=\"1\"\u003e\n\n\u003cp align=\"center\"\u003eIf you like what I present here, and if it helps you above, donate me a cup of coffee :coffee:.\u003cbr\u003eI drink a lot of coffee while programming and writing  :smiley:.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.buymeacoffee.com/zentrocdot\" target=\"_blank\"\u003e\u003cimg src=\"\\IMAGES\\greeen-button.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eI loved the time when you could get also a hamburger :hamburger: for one euro!\u003c/p\u003e\n\n\u003chr width=\"100%\" size=\"1\"\u003e\n\n\u003cp align=\"justify\"\u003eHere are some other good ways to simply donate a coffee to me via my favourite coins :moneybag:.\u003c/p\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eTQamF8Q3z63sVFWiXgn2pzpWyhkQJhRtW7\u003c/td\u003e\n      \u003ctd\u003eTron\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eDMh7EXf7XbibFFsqaAetdQQ77Zb5TVCXiX\u003c/td\u003e\n      \u003ctd\u003eDoge\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e12JsKesep3yuDpmrcXCxXu7EQJkRaAvsc5\u003c/td\u003e\n      \u003ctd\u003eBitcoin\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e0x31042e2F3AE241093e0387b41C6910B11d94f7ec\u003c/td\u003e\n      \u003ctd\u003eEthereum\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003chr width=\"100%\" size=\"1\"\u003e\n\n\u003cp align=\"center\"\u003ePage last modified 10/03/2024\u003c/p\u003e\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzentrocdot%2Fprime-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzentrocdot%2Fprime-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzentrocdot%2Fprime-numbers/lists"}