Binary linear recurrent sequences with the primitive characteristic polynomial are used as a good approximation of the random sequence. A known algorithm is implemented in a program for generation of primitive binary polynomials of degree $<5000$ with the given number of terms. An account is given of problems solved during the program developement. Practically hardest among them is the problem of obtaining the factorizations of the numbers $2n-1$.