The number sequence is determined by taking the sums of the squares of the digits of the previous terms, hence the ?? after 145_ is 20
Edit: The full sequence is 2, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, 42, 20, 4 and loops indefinitely.
I believe the formula is known as A000216.