answersLogoWhite

0


Best Answer

Set builder notation for prime numbers would use a qualifying condition as follows. The set of all x's and y's that exist in Integers greater than 1, such that x/y is equal to x or 1.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the set builder notation for prime numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a program which calculating LCM of 2 numbers in Linux?

Dunno about Linux, but I've written mine in C.It prime factorises the numbers, making a note of the highest power of each prime factor as it goes (in a linked list of malloc()ed structures). Once all the numbers have been factorised, it has a list of all the primes used along with their highest power. The lcm is then the product of the primes raised to their highest power.You are also not limited to the lcm of 2 numbers - you can keep factorising numbers until you run out of them and find the lcm of them all!Whilst you're at it you can add finding their hcf very easily: this time it's the product of the common primes to their lowest power.All that is then needed is the prime factorisation of the numbers.The normal method is:try the first prime (2)If it does not divide the number: set the prime to the next primeTry again from step 2Add one to the power count of this primereplace the number by the number divided by the primeif the number is not 1 go back to step 2Found all primes, stop!Finding the primes by which to divide is not easy on the fly, so you could check 2 specifically and then all odd numbers 3, 5, 7,..., but an improvement is to specifically check 2 and 3 and then check the numbers 6n ± 1 (which may be prime and why are 6n, 6n ± 2 and 6n ± 3 definitely not prime?) which skips every third odd number - this sequence of potential primes (5, 7, 11, 13, 17, 19, ...) can be easily generated.And while you're at it, you could display the prime factorisation you've done.And using that prime factorisation you can list the factors (and factor pairs) for the numbers.Obviously you'll need to sort out how the numbers are input to the program - I decode argv[], but you could use reading from stdin if you prefer.


How do you write a program to generate 'n' Fibonacci numbers?

I don't program in just C (I use C++) so you may have to change some of the code:int main(){int n;int last = 1;int slast = 0;int numbers[n];numbers[0] = 1;for(int i = 1; i < n; i++){numbers[i] = last + slast;slast = last;last = numbers[i];}return 0;}int n needs to be set to however many Fibonacci numbers you want to make.int last is the last number in the sequence (so far)int slast is the second last number in the sequence (so far)int numbers[n] is the int array which holds your numbersint i is the count for the loop, it is set to 1 because before the loop, I set numbers[0] to 1


What is the sort order for alphanumeric fields that contain both numbers and letters?

It depends on the collating order of the character set being used by the computer:ASCII places the numbers before the lettersEBCDIC places the numbers after the lettersFIELDATA places the numbers after the lettersetc.Some early computers had a different collating order than the numeric order of the character codes in the character set, but for modern computers the collating order is usually identical to the numeric order of the character codes.


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


How do you find the average in a set of data that includes infinity?

you start by adding all of the #'s together. then, you take that sum and divide it by the number of numbers in the set of the data. example: 120.6+129.63=250.23/2=125.115