How can you enumerate all prime factors of a number in a set

159 Views Asked by At

If you want to enumerate all elements of the following set:

All $x$ that are prime factors of the number 3528.

If you just write $$ A = \{2, 2, 2, 3, 3, 7, 7\} $$ it is not correct because each element should be unique.

How can you solve this?

Thanks a lot in advance

How shall I put it? It should be possible to describe any set, either in an enumerative or in an descriptive way. I want to have a very special set. My set is: "All numbers that are the result of my prime factor framentation".

2

There are 2 best solutions below

0
On

Given any number N and then factorise it. We will get N=a^2*b^2*c^2.. where a, b and c are the prime factors of the number N.After factorising the number then write the set as { a,b,c,.. } which consist of all prime factors of N. Hope it helps.

0
On

Thank you, lulu, for giving me this hint with the tuples.

My set is very special. The set is not only the prime factors (per se) of the number $3528$, but the result, when I perform a prime factor framentation of the number $3528$, which are the numbers $2, 2, 2, 3, 3, 7, 7$.

When I use tuples within the set, it is possible to write the set: $$ A = \{ (2,2,2), (3,3), (7,7) \} $$