10 Topics
|
|
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 … |
|
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 … |
|
**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 … |
|
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 … |
|
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 … |
|
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 |
|
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 … |
|
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++; } … |
|
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 … |
|
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 … |
The End.