Corrected a bug resulting in an error when producing HDPC symbols.
The bug was caused by not generating enough elements of the gray
sequence to support large values of k. The bug is fixed by
generating the first 65536(2^16) elements instead of the only the
first 8192 elements. Before the fix, k's less than 1638 would work.
All k's should now work.

My thanks to mlukoskov for pointing out the bug.

This change also includes some minor tweaks to reduce the cost of
computing the gray sequence.

This change also corrects some typos in the comments of raptor.py.