Low-depth quantum architectures for factoring