TITLE: Finite groups with elements of the same order
QUESTION [15 upvotes]: Given a finite group $G$, let $\{(1,1),(m_1,n_1),\ldots,(m_r,n_r)\}$ be the list of pairs $(m,n)$ in which $m$ is the order of some element, and $n$ is the number of elements with this order. The order of $G$ is thus $1+n_1+\cdots+n_r$, and the pair $(1,1)$ accounts for the neutral element.
Let $G,G'$ be two finite groups, with the same list. Is it true or not (I bet not) that $G$ and $G'$ are isomorphic ? If not, please provide a counter-exemple. 
Edit. Nick's answer gives the correct terminology, of conformal groups. Ben's answer speaks of the refined notion of almost conjugate subgroups. Is there any other related notion ?

REPLY [15 votes]: This question was answered more than five years ago, but I am just now noticing it and wanted to point out that non-isomorphic groups with the same order portraits arise very naturally in spectral geometry and underlie Sunada's Method of constructing isospectral Riemannian manifolds.
Let $G$ be a finite group and $H_1, H_2$ be subgroups of $G$. We say that $H_1$ and $H_2$ are almost conjugate if every $G$-conjugacy class intersects both subgroups in the same number of elements. 
An easy argument shows that almost conjugate subgroups have the same order portraits. 
The connection of these groups to geometry stems from a theorem of Sunada that says that if $G$ acts by isometries on a Riemannian manifold $M$ and $H_1$ and $H_2$ are almost conjugate subgroups of $G$ then the quotient orbifolds $M/H_1$ and $M/H_2$ are isospectral with respect to the Laplace operator.
This paper by Brooks, Gornet and Gustafson gives explicit examples of arbitrarily large families of almost conjugate subgroups of Heisenberg groups defined over various commutative rings. The examples are then applied so as to construct families of isospectral non-isometric genus $g$ Riemann surfaces having cardinality $g^{c\log(g)}$ (here $c>0$ is a positive constant).
EDIT: In light of Nick's comment above I wanted to say a few words about Gassmann equivalence. To start with, by definition, two subgroups $H_1$ and $H_2$ of a finite group $G$ are Gassmann equivalent if and only if they are almost conjugate. The history of the term arises from a connection of these groups with number theory.
To an algebraic number field $k$ one can associate a Dedekind zeta function $\zeta_k(s)$. (If $k$ were the field of rational numbers then $\zeta_k(s)$ would be the Riemann zeta function.) This function determines all sorts of arithmetic properties of $k$: the discriminant, signature, splitting of primes, product of class number times regulator, etc. It is therefore natural to ask whether $k$ is determined up to isomorphism by $\zeta_k(s)$. It turns out that this is not in general true. We will therefore say that two number fields with the same Dedekind zeta function are arithmetically equivalent. The first examples of arithmetically equivalent number fields were discovered by Fritz Gassmann in 1925 and made use of the almost conjugacy condition defined above.
The term 'Gassmann equivalent' is due, I believe, to Robert Perlis. On page 344 of this paper Perlis defines subgroups $H_1$ and $H_2$ of $G$ to be Gassmann equivalent if every $G$-conjugacy class intersects $H_1$ the same number of times as $H_2$, which of course is precisely the same thing as saying that $H_1$ and $H_2$ are almost conjugate. Perlis then proves the following remarkable theorem.
Theorem (Perlis): Let $k$ be a Galois number field and $k_1, k_2$ be subfields of $k$. Then $\zeta_{k_1}(s)=\zeta_{k_2}(s)$ if and only if $\text{Gal}(k/k_1)$ and $\text{Gal}(k/k_2)$ are Gassmann equivalent subgroups of $\text{Gal}(k/\mathbb Q)$.

REPLY [10 votes]: The smallest counterexamples have order $16$.
Up to isomorphism, there are $14$ groups of order $16$;
these fall into $9$ distinct equivalence classes w.r.t. order portrait.
The $3$ equivalence classes containing more than one group can be found
with GAP as follows:
gap> OrderPortrait := G -> Collected(List(AsList(G),Order));;
gap> List(Filtered(EquivalenceClasses(AllGroups(16),OrderPortrait),
>                  cl->Length(cl)>1),
>         cl->List(cl,IdGroup)); # in terms of catalog id numbers of groups
[ [ [ 16, 5 ], [ 16, 6 ] ], [ [ 16, 2 ], [ 16, 4 ], [ 16, 12 ] ],
  [ [ 16, 3 ], [ 16, 10 ], [ 16, 13 ] ] ]
gap> List(last,Length); # two classes have length 3, and one has length 2
[ 2, 3, 3 ]
gap> List(Filtered(EquivalenceClasses(AllGroups(16),OrderPortrait),
>                  cl->Length(cl)>1),
>         cl->List(cl,StructureDescription)); # the structure of the groups
[ [ "C8 x C2", "C8 : C2" ], [ "C4 x C4", "C4 : C4", "C2 x Q8" ],
  [ "(C4 x C2) : C2", "C4 x C2 x C2", "(C4 x C2) : C2" ] ]
gap> List(Filtered(EquivalenceClasses(AllGroups(16),OrderPortrait),
>                  cl->Length(cl)>1),
>         cl->OrderPortrait(cl[1])); # the actual order portraits
[ [ [ 1, 1 ], [ 2, 3 ], [ 4, 4 ], [ 8, 8 ] ], 
  [ [ 1, 1 ], [ 2, 3 ], [ 4, 12 ] ], [ [ 1, 1 ], [ 2, 7 ], [ 4, 8 ] ] ]

REPLY [10 votes]: Let me join Stefan in resurrecting this question. I want to mention a fascinating observation of Thompson.
Apparently two groups $G$ and $G'$ that, in Denis' terms "have the same list" are, in the literature called conformal (see Mazurov-Shi in Groups St Andrews 1999).
J.G.~Thompson famously gave an example of two non-isomorphic conformal groups: $2^4:A_7$ and $L_3(4):2_2$. These two groups both appear as maximal subgroups of $M_{23}$, one of the sporadic Mathieu groups.
Along with this observation, Thompson posed the following question:

Suppose that $G$ and $G'$ are conformal, and that $G'$ is solvable. Is $G$ solvable?

As far as I know, this question remains open. However there has been a lot of progress in the study of conformality amongst non-solvable groups. I'm thinking of results of the kind: Suppose that $G$ and $G'$ are conformal, and that $G'$ is [insert name of some simple group], then $G\cong G'$. 
I refer those interested to the above-mentioned survey of Mazurov--Shi for several results of this kind (and many other interesting results).