Representation of integers as quadratic forms with integer coefficients While reading the book The sensual (quadratic) form by J.H. Conway I got curious in this question. Maybe it is trivial, but I don't know how to answer it.
Let $f(x,y)=ax^2+hxy+by^2$, $g(x,y)=a'x^2+h'xy+b'y^2$ be two positive definite quadratic forms with integer coefficients $a,b,h,a',b',h'\in\mathbb{Z}$.
Let $N_f(n)$ be the number of representations of an integer $n\ge 0$ by the quadratic form $f(x,y)$:
$$
N_f(n)=\left\{\text{#}~{\rm{of}}~x,y\in\mathbb{Z}~ {\rm such~ that}~n=f(x,y) \right\}.
$$

Q: Are there two positive definite quadratic forms $f$ and $g$ with integer coefficients such that 
  $1)~N_f(n)=N_g(n)$ for all integers $n\ge 0$ and 
  $2)~f$ and $ g$ are not related by a transformation $x\to Ax$, $A\in {SL_2(Z)}$.

 A: Well, no. If two positive binary forms agree, including representation counts, they are the same or "opposite." So, as you wrote $SL_2 \mathbb Z$ instead of $GL_2 \mathbb Z,$ the one bit of wiggle room is given by pairs such as
$$ 2 x^2 + xy + 3 y^2, \; \; \;  2 x^2 - xy + 3 y^2  $$
See page 45 in Conway's book, sketch of proof for binary forms. 
The same thing happens in three variables, although in odd dimension we cannot distinguish effectively between positive and negative determinant in "equivalence." This should be in the book somewhere, result of my co-author Alexander Schiemann. Alexander also found the first example in dimension 4, two distinct forms with same representation counts. From
Nipp 1708-1732
d      g  f11 f22 f33 f44 f12 f13 f23 f14 f24 f34   H         N      G   m1   m2
1729  4:   2   4   4   5   1   0   1   1   3   4 ; -1 1-1 1  1729    2  703   48
1729  4:   2   4   5   5   2   1  -2   1   1   5 ; -1 1-1 1  1729    2  703   48


  [ 2f11   f12   f13   f14 ]
  [ f12   2f22   f23   f24 ]
  [ f13   f23   2f33   f34 ]
  [ f14   f24   f34   2f44 ]


 In the discriminant tables there is one line for each form, containing 17 entries:

d   g   f11   f22   f33   f44   f12   f13   f23   f14   f24   f34   H   N   G   m1   m2  

where
      d = discriminant,
      g = identification number of genus to which f belongs,
      f11 ... f34 are the coefficients,
      H = Hasse symbol at all primes p dividing 2d, in increasing order of p (using 10 characters),
      N = level of   f = smallest N such that N F^(-1) has integer entries and even diagonal entries,
      G = number of automorphisms of   f,
      m1/m2 = the total mass of this genus 

Schiemann 1990

On positive binaries, Kaplansky and I collected all pairs of forms that simply agree on the primes represented, ignoring frequency of representation. This was polished and corrected by John Voight, and published. 
