Consider the general case where $S\subset \mathbb{Z}$.
Let $A_i:=\{n\in S: n\equiv i \pmod{3} \}$, for $i=0,1,2$.
Then the sum of three distinct numbers of $S=A_0\cup A_1\cup A_2$ is divisible by $3$ iff it has one of these forms:
$$a_0+a_0+a_0,\quad a_1+a_1+a_1,\quad a_2+a_2+a_2,\quad a_0+a_1+a_2$$
with $a_i\in A_i$.
Now enumerate them and you will get:
$$\binom{|A_0|}{3}+\binom{|A_1|}{3}+\binom{|A_2|}{3}+|A_0||A_1||A_2|$$
where $|A_i|$ denotes the cardinality of the set $A_i$.
My common use case is large sets (thousands or millions of elements) but only a handful of links.
For me a clustered recursion seems to be a good algorithm. The idea is simple but it is a bit hard for me to explain it clearly. I’ll hope you’ll understand it from the below. An input for a clustered recursion is the following. Assume that we are given sets $S_1,\dots, S_n$. Then for each $i$ and each subset $I$ of $\{i+1,\dots, n\}$ we count a number $(i,I)$ of elements of $S_i$ which linked to exactly members of $I$. Also assume that we are given a subset $Z$ of $\{1,\dots, n\}$ of indices $i$ of sets $S_i$ which do not need links to be listed. Clearly, suffices to consider reduced inputs $(i,I)$ with $I\cap Z\varnothing$, with $(i,I):=\sum \{(i,I’):I\subset I’\subset I\cup Z\}$. For instance, in your example we have $n=3$, $Z=\{1\}$, $(1,\{2\})=1$, $(1,\{3\})=2$, $(1,\varnothing)=1$, $(2,\varnothing)=3$, $(3,\varnothing)=2$, and all other $(i,I)$ are zero. Then using the same arguments as in the question, we can count the total number $N$ of possibilities as follows. For each subset $I$ of $\{2,\dots, n\}$ we recursively calculate the total number $N_I$ of possibilities in which the first element is linked with exactly members of $I$ and then count $N=\sum \{N_I: I\subset \{2,\dots, n\}\}$. For instance, in your example there are
$(1,\{2\})=1$ choice to choose an element linked exactly with the set $S_2$. In this case we add $2$ to and remove $1$ from the set $Z$ of indices of sets which do not need links to be listed. This gives us the same problem, but with the smaller number of sets. Since the elements of the set $S_2$ are not linked with other sets, in this case we have only $(2,\varnothing)=3$ choices. So in total we have $N_{\{2\}}=(1,\{2\})(2,\varnothing)=3$.
$(1,\{3\})=2$ choices to choose an element linked exactly with the set $S_3$. In each of these cases we add $3$ to and remove $1$ from the set $Z$. This gives us the same problem, but with the smaller number of sets. Since the elements of the set $S_3$ are not linked with other sets, in this case we have only $(3,\varnothing)=2$ choices. So in total we have $N_{\{3\}}=(1,\{3\})(3,\varnothing)=4$.
$(1, \varnothing)=1$ choice to choose an element not linked with any set $S_i$. In this case we remove $1$ from the set $Z$, but add to it nothing. So in total we have $N_\varnothing =(1,\varnothing)=1$.
Thus we have $N= N_\varnothing + N_{\{2\}}+ N_{\{3\}}=1+3+4=8$.
Best Answer
To summarize the discussion in the comments:
Given that we are choosing from the list $\{1,3,5,\cdots, 151\}$, that is, the odd integers from $1$ to $151$, inclusive, there are $15$ multiples of $5$ available, and $61$ non-multiples of $5$.
We wish to count the ways to choose two distinct terms from this list such that at least one of them is a multiple of $5$. The spirit of the first calculation is: first count those pairs in which both terms are multiples of $5$ then add the pairs in which exactly one is a multiple of $5$. The arithmetic is off, however, and the formula ought to read $$\binom {15}2+\binom {15}1\times \binom {61}1=1020$$
The second method is flawed because it double counts those pairs in which both terms are multiples of $5$. We can fix that by subtracting the number of such pairs, namely:
$$\binom {15}1\times \binom {75}1-\binom {15}2=1020$$
As a third method, in the spirit of the proposed solution from @ChristianBlatter, we can count all possible pairs and subtract off those in which neither term is a multiple of $5$. Thus: $$\binom {76}2-\binom {61}2=1020$$