primes
How does this regex find primes? [duplicate]
This question already has answers here: Closed 12 years ago. Possible Duplicate: How to determine if a number is a prime with regex?[详细]
2023-01-07 23:20 分类:问答Improving a prime sieve algorithm
I\'m trying to make a decent Java program that generates the primes from 1 to N (mainly for Project Euler problems).[详细]
2023-01-04 03:58 分类:问答Finding the nth number of primes
I can not figure out why this wo开发者_如何学编程n\'t work. Please help me from math import sqrt[详细]
2023-01-03 19:05 分类:问答Project Euler #10 Java solution not working
I\'m trying to find the sum of the prime numbers < 2,000,000. This is my solution in Java but I can\'t seem get the correct answer. Please give so开发者_Go百科me input on what could be wrong and ge[详细]
2023-01-03 18:00 分类:问答Clojure: Avoiding stack overflow in Sieve of Erathosthene?
Here\'s my implementation of Sieve of Erathosthene in Clojure (based on SICP lesson on streams): (defn nats-from [n][详细]
2023-01-02 09:30 分类:问答Recursive function causing a stack overflow
I am trying to write a simple sieve function to calculate prime numbers in clojure.I\'ve seen this question about writing an efficient sieve function, but I am not to that point yet.Right now I am jus[详细]
2023-01-01 23:19 分类:问答Generating exactly prime number with Java
I\'m aware of the function BigInteger.probablePrime(int bitLength, Random rnd) that outputs probably prime number of any bit length. I want a REAL prime number in Java. Is there any FOSS library to do[详细]
2022-12-31 07:56 分类:问答Sum of all primes under 2 million
I made a program that returns the sum of all primes under 2 million. I really have no idea what\'s going on with this one, I get 142891895587 as my answer when the correct answer is 142913828922. It s[详细]
2022-12-30 05:01 分类:问答Checking if an int is prime more efficiently
I recently was part of a small java programming competition at my school. My partner and I have just finished our first pure oop class and most of the questions were out of our league so we settled on[详细]
2022-12-29 02:23 分类:问答Have I checked every consecutive subset of this list?
I\'m trying to solve problem 50 on Project Euler. Don\'t give me the answe开发者_运维百科r or solve it for me, just try to answer this specific question.[详细]
2022-12-28 17:03 分类:问答