An algorithm for obtaining the probability distribution of the first return time R-n with an overlapping for the initial n-block is presented and used to test pseudorandom number generators. First, the averages and the standard deviations of R-n, rootR(n) and log R-n are computed theoretically and next their sample values are obtained and finally, the usual Z-test is applied. (C) 2002 Elsevier Science B.V. All rights reserved.