requiredBytesForElements

Utility to compute how many bytes are needed for a given number of ternary elements.