primes
Calculating Extremely Large Powers of 2
I have made a program in Java that cal开发者_Python百科culates powers of two, but it seems very inefficient. For smaller powers (2^4000, say), it does it in less than a second. However, I am looking a[详细]
2023-01-23 08:37 分类:问答Implementation of Fermat's primality test
Who wants to help me with my homework? I\'m try to implement Fermat\'s primality test in Java using BigIntegers. My implementation is as follows, but unfortunately it doesn\'t work.Any ideas?[详细]
2023-01-22 06:29 分类:问答Prime test, 2-digit numbers
I want to print all prime numbers that are 2-digits long. Here is my code: for(int input = 11; input <= 99; input += 2){[详细]
2023-01-22 02:21 分类:问答BigIntegers to the power of BigIntegers
I am trying to implement either the Fermat, Miller-Rabin, or AKS algorithm in Java using the BigInteger class.[详细]
2023-01-21 21:18 分类:问答My Sieve of Eratosthenes takes too long
I have implemented Sieve of Eratosthenes to solve the SPOJ problem PRIME1. Tho开发者_运维问答ugh the output is fine, my submission exceeds the time limit. How can I reduce the run time?[详细]
2023-01-19 07:19 分类:问答Sieve of Eratosthenes in Haskell
I\'m solving some classic problems in Haskell to develop my functional skills and I have a problem to implement an optimization suggested at this \"Programming Praxis\" site:[详细]
2023-01-19 01:41 分类:问答Segmentation fault in Prime Number generator
I am aware the following isn\'t the fastest way of generating a list of primes however I posed myself the problem and before googling wrote the following program. It works fine for numbers < ~ 44,0[详细]
2023-01-18 23:34 分类:问答Finding the nth prime number using Python
When I run this code, even for just counting to the 10th prime number (instead of 1000) I get a skewed/jacked output--all \"not prime\" titles for my is_composite variable, my test_num is giving me pr[详细]
2023-01-18 23:27 分类:问答Are You A Prime Number
I\'ve been interested in the problem of finding a better prime number recognizer for years.I realize this is a huge area of academic research and study - my interest in this is really just for fun.Her[详细]
2023-01-18 01:44 分类:问答Generate a list of primes up to a certain number
I\'m trying to generate a list of primes below 1 billion.I\'m trying this, but this kind of structure is pretty shitty.Any suggestions?[详细]
2023-01-17 17:20 分类:问答