added binary-pattern-based number generator