I came across the group with a presentation $A_n = \langle a_1,\ldots a_n \,\, a_i a_j = a_ja_i \mbox{ if } ij >= 2\rangle$. E.g. $A_1$ and $A_2$ are free groups. Do these groups have a name or are they special cases of some classes of groups? I would like to know as much as possible about it. It's somehow connected to the symmetric group I guess.

1$\begingroup$ Braid group of some kind? $\endgroup$ – paul garrett Jun 18 '18 at 18:34

20$\begingroup$ This is a rightangled Artin group (en.wikipedia.org/wiki/Artin_group) $\endgroup$ – Neil Strickland Jun 18 '18 at 18:39

2$\begingroup$ No it is definitely not a Coxeter group. All generators of Coxeter groups have order $2$ and $A_n$ is torsionfree. $\endgroup$ – Derek Holt Jun 18 '18 at 19:24

2$\begingroup$ Right angled Artin groups are themselves a special case of graph products of groups, in which you have a collection of groups $\{G_i : i \in I \}$ and a graph with $I$ as vertex set. If vertices $i$ and $j$ are joined, then all element sof $G_i$ commute with all elements of $G_j$. Otherwise there are no relations apart from those coming from the $G_i$ themselves. So it includes direct and free products as special cases. $\endgroup$ – Derek Holt Jun 19 '18 at 7:37

2$\begingroup$ The guess that it's some kind of Coxeter group isn't too far off: every rightangled Artin group is commensurable with a rightangled Coxeter group. (Davis & Januszkiewicz, Rightangled Artin groups are commensurable with rightangled Coxeter groups, 2000.) $\endgroup$ – HJRW Jun 19 '18 at 11:07
I'll add my comment above as an answer and include some context, incorporating others' comments.
Given an undirected graph $\Gamma$, the group $A(\Gamma)$ is defined by the presentation
$$ \langle v \in V(\Gamma) \mid vw = wv \text{ for each } vw \in E(\Gamma) \rangle, $$ where $V(\Gamma)$ and $E(\Gamma)$ are the vertex and edge sets and $vw$ denotes an edge with end vertices $v$ and $w$. A group admitting such a presentation for some such graph is known by any of the following names: rightangled Artin group (RAAG), graph group, partially commutative group, free partially commutative group.
The group in the OP's question is a graph group. More precisely, we can identify the underlying graph as follows.
Let $P_n$ be the path graph on $n$ vertices: $V(P_n) = \{1, \dots, n\}$ and $E(P_n) = \{ ij \mid ij = 1\}$. Let $\overline{P_n}$ be the opposite (or complement) graph of $P_n$. This means that $V(\overline{P_n}) = V(P_n)$ and $E(\overline{P_n}) = \{ij \mid ij \neq 1\}$.
Comparing the presentations, we see that $A(\overline{P_n})$ is the group in the original post.
Of possible interest: a graph which defines a graph group is intrinsic to the group. What I mean is that if $A(\Gamma_1) \cong A(\Gamma_2)$, then $\Gamma_1 \cong \Gamma_2$. So, in principal, everything one might want to know about the group is encoded in the graph and vice versa. This statement was proved by Droms. This also follows from the work of Kim, MakarLimanov, Neggers, and Roush on graph algebras, the group algebra (over some field) of a graph group.
If one adds the relations $v^2=1$ for each $v \in V(\Gamma)$, then the resulting presentation defines (by definition) a rightangled Coxeter group $W(\Gamma)$. Symmetric groups are Coxeter groups, but they are not rightangled Coxeter groups. So, the OP's group is not related to a symmetric group in any direct way. The group $W(\overline{P_n})$ is infinite for $n \geq 5$ and seems to be as difficult to analyze as the original group $A(\overline{P_n})$.

1$\begingroup$ I only disagree that it is difficult to analyze. See our paper with Crisp and Sageev where such groups are analyzed: front.math.ucdavis.edu/0707.1144 $\endgroup$ – user6976 Jul 30 '18 at 16:21

1$\begingroup$ Also, of course the group is related to $S_{n+1}$ because it maps onto it. But the group is infinite, torsionfree, etc. $\endgroup$ – user6976 Jul 30 '18 at 17:34

$\begingroup$ @MarkSapir Thank you for the correction. I see now that $A(\overline{P_n})$ maps to the braid group by adding the braid relations $v_i v_{i+1} v_i = v_{i+1} v_i v_{i+1}$ for $i = 1, \dots, n1$ and then to $S_{n+1}$ by adding the relations $v_i^2 = 1$. $\endgroup$ – Robert Bell Jul 30 '18 at 20:50

$\begingroup$ That is true. I think also that for $n\ge 4$ the group contains a copy of a hyperbolic surface group. $\endgroup$ – user6976 Jul 31 '18 at 2:59