Say we have the set $S=\{1, 2, 3, ..., 20\}$ and we define our relation (R) as
For every $x, y \in S$, $xRy$ iff for every prime $p, p | x \iff p | y$
This relation is an equivalence relation (as it is reflexive, symmetric and transitive) so I want to go ahead and find the equivalence classes for this relation.
So from my understanding, I'm looking for the ordered pairs in $S$ where $x$ and $y$ share a prime factor. With this in mind I believe one of the classes would be $\{5, 10, 15, 20\}$ as they all share the prime $5$ as a factor. I was wondering if there was some sort way to determine and list these equivalence classes without manually going through and listing all the ordered pairs?
Edit - I understand my initial understanding of the relation was incorrect and $\{5, 10, 15, 20\}$ isn't a valid equivalence class.
The primes $\le 20$ are $\{2,3,5,7,11,13,17,19\}$.
A number has a unique prime factorization. And two numbers are equivalent if there prime factors is from the same set of primes.
So consider ever possible set of primes:
Set 1: $\emptyset$. Consider the set of numbers with no prime factors. That is $\{1\}$ So that is the first equivalence class $\{1\}$
Set 2: $\{2\}$. Consider the set of numbers with only $2$ as a prime factor. That is $\{2^k\}= \{2,4,8,16\}$. That's the second equivalence class.
Set 3: $\{2,3\}$. Consider $\{2^m3^n\} = \{6, 12,18\}$. That's the third class.
Set $\{2,3,5\}$. Well $2*3*5=30$ and ther are no such numbers. The cant be any other sets with $2$ and $3$.
Set 4: $\{2,5\}$. Consider $\{2^m5^n\}=\{10,20\}$. That's the fourth
Set $\{2,5,7\}$. Well, $2*5*7=70$ so there are no more three element sets with $2$.
Set 5: $\{2,7\}$. Consider $\{2^m7^n\} = \{14\}$. That's the fifth.
And $2*11=22> 20$ so there are no more sets containing $2$.
Set 6: $\{3\}$ and the sixth equivalence class is $\{3^k\} = \{3,9\}$.
Set 7: $\{3,5\}$ and the seventh equivalce class is $\{3^m5^n\}=\{15\}$.
$3*7=21$ so there are no more sets with $3$. And for and primes $p, q > 3$ then $pq \ge 5*7=35$ so there are no more set to consider than just the sets with a single prime.
So the next equivalence classes are:
Set 8: $\{5\}$. The eighth equivalence class is $\{5^k\}=\{5\}$. Note for $p\ge 5$ then $p^2 > 20$ so the next equivalence classes will only contain the primes.
So
Class 9: $\{7\}$; Class 10: $\{11\}$; Class 11: $\{13\}$; Class 12: $\{17\}$; Class 13: $\{19\}$.
....