9
votes
3answers
543 views

Finding largest prime factor from inputted number

This is my first C# console application. This program asks for an input of a number, and finds the highest prime factor of that number. Please review my code. Have I used things right? Is my code ...
9
votes
4answers
279 views

Threshed and Malachi'd: Sieve of Eratosthenes

I took a little bit from all the answers to my previous question Threshing: Sieve of Eratosthenes. This may be bordering on code-golfing, but I think that I have a pretty good piece of code here. ...
5
votes
4answers
362 views

Threshing: Sieve of Eratosthenes

I would like a complete threshing of this code so that I can see what I did wrong and what I am using incorrectly. I made this super simple, trying to learn a little bit about ...
3
votes
2answers
632 views

Faster way to get all primes between 0 - n

Is there a faster way to get all primes between 0 - n ...
6
votes
2answers
129 views

Prime Number Speed

I know prime number programs have been beaten to death. I am have been programming for eight years (not that long, but I'm not in my 20s yet and I got a programming job straight out of high school so ...
7
votes
2answers
1k views

Finding prime factors of a number?

Okay, so just having a little fun I thought I'd see if I could write an algorithm to find all of the prime factors of a number. The solution I came up with is as follows: ...
7
votes
1answer
219 views

Prime Numbers Store

Let's say we need to create a store for selling prime numbers. Users enter the store and ask to buy a number. If the number asked is a prime number, 1.1. then it's either available for sale 1.2. ...
3
votes
1answer
98 views

Quadratic Primes

This is one of the slightly trickier Project Euler Questions I have seen (Question 27) ...
4
votes
4answers
616 views

Sum of primes less than 2,000,000

I have been attempting the questions at Project Euler and I am trying to find the sum of Primes under two million (question 10) The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the ...
3
votes
3answers
236 views

Prime numbers, Prime Factors and LCM

I am trying to generate LCM by prime factorization. I have already done the other way around to generate LCM using GCD but I am trying to achieve it using prime factorization. I am getting right ...
3
votes
6answers
4k views

Find the largest Prime Factor of the number 600851475143

I am trying to complete this challenge, which is to find the Find the largest Prime Factor of the number 600851475143. My current solution is below: ...
4
votes
3answers
222 views

Finding and testing primality

I have written a class who is responsible for both enumerating primes and testing the primality of a number. Here is the code : ...
28
votes
6answers
4k views

I wrote a program in C# to calculate prime numbers making use of Parallel.ForEach, please critique

In spare time I decided to write a program that would systematically identify prime numbers from 2 to 18,446,744,073,709,551,615. This is for fun and learning, as I know it will take too long to ...