How to find an integer matrix $P$ such that $PAP^{-1}=B$ for given two similar, integer matrices $A$ and $B$? An integer matrix is a matrix whose coefficients are integers.
Suppose that two given invertible, integer $3\times 3$ matrices $A$ and $B$ are similar to each other, that is, there exists an invertible, integer matrix $P$ such that $PAP^{-1}=B$. 
Assuming that we know such a matrix $P$ exists, how can we concretely find $P$?
I would like to know how to find $P$ for the case that $A=\begin{bmatrix}0&25&37\\ 0&2&3\\1&0&38\end{bmatrix}$ and $B=\begin{bmatrix}0&23&297\\ 0&12&155\\1&0&28\end{bmatrix}$. 
(One can check that $A$ and $B$ are similar by using a theorem of Latimer and MacDufee.)
 A: Note that $\chi_A(x)=\chi_B(x)=p(x)=x^3-40x^2+39x-1$ is irreducible and has $3$ distinct roots $(\lambda_i)$. Here $PA=BP$ with $\det(P)=1$; then $P$ sends any eigenvector of $B$ associated to $\lambda_i$ to an eigenvector of $A$ associated to the same $\lambda_i$; moreover, the eigenvectors are defined up to a multiplicative constant. The set $\{R;RA=BR\}$ is a vector-space of dimension $3$. Then an equality of the form $Ru=v$, where $u,v$ are given vectors, define in general a unique $R$.
An eigenvector of $A$ (resp. of $B$) associated to $\lambda_i$ is $U_i=[1+37\lambda_i,3\lambda_i,-2\lambda_i+\lambda_i^2]^T$ (resp. $W_i=[1+297\lambda_i,155\lambda_i,-12\lambda_i+\lambda_i^2]^T$) and $P(U_i)=a_iW_i$ where $a_i\in\mathbb{C}$. It is easy to see that $U=\sum_iU_i=[1483,120,1442]^T$ and $P(U)=\sum_ia_iW_i$ is an integer vector.
Thus (*) $\sum_ia_i,\sum_ia_i\lambda_i,\sum_ia_i\lambda_i^2$ are rational numbers and the $(a_i)$ are in $F$, the decomposition-field of $p$. On the other hand, $\dfrac{\det(U_1,U_2,U_3)}{\det(W_1,W_2,W_3)}=3/155$ implies that $a_1a_2a_3=3/155$. 
Consequently, the $(a_i)$ are the roots of a polynomial $q(y)$ that is the image of $p$ by a transformation $y=u+vx+wx^2$ where $u,v,w$ are rational numbers. Note that $q$ must be in the form $q(y)=y^3+\cdots-3/155$. We seek solutions $(u,v,w)$ in the form $n/155$ where $n\in\mathbb{Z}$ and we obtain $3$ candidates: $(-13/155,28/155,-1/155),(-1/155,26/155,-12/155),(12/155,-2/155,-11/155)$ (maybe there are other solutions). It remains to see that the associated solutions $P$ are (or are not) integer-matrices.
Case 1. We obtain $P(U)=[-33012,-17227,-3004]^T$ and $P$ is the matrix obtained by Axel Kemper (with the little radius). $P$ is an integer matrix and is convenient.
Case 2. We obtain $P(U)=[-1288409,-672344,-117124]^T$, $P=\begin{pmatrix}-23&2&-870\\-12&1&-454\\-2&-2&-79\end{pmatrix}$ and $P$ is convenient.
Case 3. We obtain $P(U)=[-1255397,-655117,-11412]^T$; yet, $P$ is not an integer matrix and is not convenient
EDIT. Answer to @user7540.
Since $galois(p)=S_3$, there are no algebraic relations with coefficients in $\mathbb{Q}$ linking the $(a_i)$ and there is a cycle $\sigma\in Galois(p)$ s.t. $\sigma(\lambda_i)=\lambda_{i+1}$. According to (*) above, $a_i\in F$, the decomposition-field of $p$ and (reverse the Vandermonde matrix) $a_1=u+v\lambda_1+w\lambda_i^2,a_2=\sigma(a_1),a_3=\sigma(a_2)$, where $u,v,w$ are rational numbers. Finally, the $(a_i)$ are the roots of a polynomial that is the image of $p$ by the transform $x\rightarrow u+vx+wx^2$.
A: Along the lines of this related post:
Transform equation
$$PAP^{-1}=B$$
to
$$PA = BP$$
by multiplying both sides of the equation with matrix $P$.
Then, you find the solution via a calculation of Eigenvectors.

Alternative:
Ask the MiniZinc constraint solver:
int: n = 3;

array[1..n, 1..n] of int: A = [| 0, 25,  37
                               | 0,  2,   3
                               | 1,  0,  38 |];
array[1..n, 1..n] of int: B = [| 0, 23, 297
                               | 0, 12, 155
                               | 1,  0,  28|];
array[1..n, 1..n] of var -20000 .. 20000: P;

constraint forall(i in 1..n, j in 1..n)(
    sum(k in 1..n)(P[i,k]*A[k,j]) == sum(k in 1..n)(B[i,k]*P[k,j])
);

solve satisfy;

output [if j == 1 then "\n" else "" endif ++ show(P[i, j]) ++ " " | i in 1..n, j in 1..n];

Result is 
$$P=\begin{bmatrix}19995&-17948&-19979\\ 
8093&19876&-10454\\ 
-694&23&563\end{bmatrix}$$
By decreasing the search radius, I arrived at
$$P=\begin{bmatrix}-2&26&-23\\ 
-1&13&-12\\ 
0&-1&-2\end{bmatrix}$$
