faster sprand, new randsubseq (fixes #6714 and #6708)