Skip to main content
1 of 4
Brendan McKay
  • 37.7k
  • 3
  • 80
  • 147

The number of ordered pairs of commuting functions is A181162. I agree with those counts up to n=6. There is little in OEIS that helps to answer the asymptotics question.

Incidentally, the probability that $f(g(1))=g(f(1))$ is not $1/n$. I think it is $1/n + (n-1)/n^3$ though I might have miscalculated. That formula works up to $n=6$.

Brendan McKay
  • 37.7k
  • 3
  • 80
  • 147