Small nitpick on problem 1 fun fact. I think you meant 509202. 509203 is already prime so the price would be 509203. The way you set up the problem (2a_n+1) only gets to (k*2^n-1) if you start with k-1, so your k needs to be one smaller than the Wikipedia's k.
on /blog/90