In how many ways we can create unique pairs of two numbers from $[1,9]$, such that the difference between them is never $1$

combinationscombinatorics

In how many ways we can form unique pairs of two numbers ( referring to integers ), such that, a mod of the difference of two numbers in pair is never equal to $1$ i.e $\{(a, b): |b-a| \neq 1\}$ and the number in the pair is in the interval $[1, 9]$? I need unique pairs, $(a,b)$ is considered same as $(b, a)$

I'm struggling to even begin thinking about it, here is what I'm thinking
so $1$ and $9$ are different than others as they don't have two neighbors that might result in the difference being $1$, so I have two cases

Case 1: in $[2,8]$, we will have to avoid values less and greater than these.

Case 2: For $1$, and $9$, we will have $7$ intgegers to pair with,

How do I approach after that? I'm struggling to put this in the combinatorial formula. what should I choose and from which? If you can explain this, that would be great. I can't use any other method.

Best Answer

Hint:

Visual proof

  1. We count only the upper triangular half since we have $(a,b)$ equivalent to $(b,a)$.
  2. Numbers of the form $(a,a+1)$ are excluded (highlighted in light red) since the digit absolute difference equals 1
  3. Numbers of the form $(a,a)$, if permitted, are on the main diagonal.
Related Question