use integer size arguments for np.random.rand
use expand_log in calculate_series

Without this expansion, a term that was 0 was being returned:

wester: test_T8: (-log(pi) - log(2) + log(2*pi))/2

That does not simplify to 0 unless expand_log is used.