10 Topics

Member Avatar for
Member Avatar for yaldoo

Hello everyone, I am having trouble with my code to list all the prime numbers in R. This is what I have thus far: prime = 0:100 for(val in prime){ if (val == 0){ next } else if (val == 1){ next } else if(val == 2){ val = 2 …

Member Avatar for AssertNull
0
6K
Member Avatar for cse.avinash

Hello every one Can I have a better algorithm to find the nth prime number, where 1<= n <=5000000. for e.g., 1st prime number is 2. 10th prime number is 29. 100th prime number is 541. 1000th prime number is 7919. 10000th prime number is 104729. 100000th prime number is …

Member Avatar for vantrendin
1
6K
Member Avatar for erinkay528

**Here is the assignment:** Write a C++ program to calculate and display the number of primes in the first 50 “chiliads”. Your results should be exactly as presented below, under testing. Design Considerations: I think you will find your program easier to structure and write if you break it down …

Member Avatar for tinstaafl
0
314
Member Avatar for jumo1807

Hi, I am currently newbie in C++, I just learned it for around 2 weeks, My question is when I put the number, it shows if it's a prime number or not. The only problem when I put 2 and 3, it supposed to be prime numbers, but the fact …

Member Avatar for Lerner
0
133
Member Avatar for pwolf

Im stuck with the following: Define a function isPrime(number) that takes in a number as argument and return True if the number is a prime number. Hint: A number, x is a prime number if it is only divisible by 1 and x itself. By definition, 1 is not a …

Member Avatar for pwolf
0
456
Member Avatar for K0ns3rv

A little program I made to try and remeber C++, first program I've written in C++ in about a year. Tested and working under windows 7 64 bit, run via command line. If you have any improvements or ideas please leave a comment. Cheers K0ns3rv

Member Avatar for mrnutty
1
315
Member Avatar for Kanoisa

Hi all, I have begun workin on getting c++ to do physics and things for me so im working on some maths functions. starting small and working up, Just did this one on prime number generation and was wondering if anyone can point out any ways it could be ,made …

Member Avatar for Kanoisa
0
282
Member Avatar for amit.hak50

I want to find it out for the number 2345678901233.. but it is giving the error ..is there any method to find out the primes beyond the range of integer..[code]import java.util.*; public class inc { int flag=0; int h=2; public void checkprime(int k) { while(h<k){ if(k%h==0){ flag=1; } h++; } …

Member Avatar for apines
0
199
Member Avatar for miha2

Hello guys, I know it's been asked a lot about it here, but that's what I should do (though I'm not quite sure what the teacher wants, is n should be 100, 1000 and further, or use prime numbers. The "first draft" is due this Sunday, the "final draft" is …

Member Avatar for miha2
0
2K
Member Avatar for Mafia619

Hey, I've got an assignment from my computer teacher in school. I've got to make a program that displays the prime numbers in a range and also display the number of prime numbers that are present. And i'm only supposed to use the basic header files.....that means the program should …

Member Avatar for VernonDozier
0
287

The End.