Trying a few more, In[6]:= Select[Range[10^9], PowerMod[2, #, #^2] == 2 &] // tim During evaluation of In[6]:= 2031.078479,2 Out[6]= {1093, 3511} Rich? Anybody? Is it obvious this can only yield primes? Time to add the conjecture to A001220? --rwg On Mon, Mar 12, 2018 at 12:36 PM, Bill Gosper <billgosper@gmail.com> wrote:
https://oeis.org/A077816 , e.g., In[19]:= Select[Range@9999, Mod[2^EulerPhi@#, #^2] == 1 &]
Out[19]= {1093, 3279, 3511, 7651}
A different definition might be In[18]:= Select[Range@999999, Mod[2^#, #^2] == 2 &]
Out[18]= {1093, 3511}
No mention of primes! https://oeis.org/A001220
Arthur Wieferich showed that if p is not a term of this sequence, then the First Case of Fermat's Last Theorem has no solution in x, y and z for prime exponent p (cf. Wieferich, 1909). - Felix Fröhlich <https://oeis.org/wiki/User:Felix_Fröhlich>, May 27 2016
--rwg