jefftk.com/p/fermat-numbers

I noticed while working on something else that 255 is 1517, and 65535 is 255257. In other words, it sounds like: 2^(2^n)-1 * 2^(2^n)+1 = 2^(2^(n+1)) - 1 Testing some numbers, it looks like this works: n 2^(2^n)-1 2^(2^n)+1 2^(2(n+1)) - 1 0 1 3 3 1 3 5 15 2 15 17 255 3 255 257 65535 4 65535 65537 4294967295 And in fact we can prove that it holds for all n: 2^(2^n)-1 * 2^(2^n)+1 = 2^(2^n)2^...


Comments (0)

Sign in to post comments.