N should be 64 bit, but define a sane maximum.