FindInstance for sum of primes
- To: mathgroup at smc.vnet.net
- Subject: [mg115478] FindInstance for sum of primes
- From: leigh pascoe <leigh at evry.inserm.fr>
- Date: Tue, 11 Jan 2011 19:25:14 -0500 (EST)
Dear Mathgroup, 2011 is the sum of 11 consecutive primes. I want to check if any other years have a similar property. Now define f[n_, m_] := Sum[Prime[i], {i, n, n + m}]; eq = Mod[f[n, m] - year, 1000] == 0 and we see that In[64]:= Mod[f[37, 10] - 2011, 1000] Out[64]= 0 but In[65]:= FindInstance[eq, {n, m, year}, Integers] During evaluation of In[65]:= FindInstance::exvar: The system contains a nonconstant expression i independent of variables {n,m,year}. >> Out[65]= FindInstance[Mod[-year + \!\(\*UnderoverscriptBox[\(\[Sum]\), \(i = n\), \(m + n\)]\(Prime[i]\)\), 1000] == 0, {n, m, year}, Integers] Apparently FindInstance doesn't like the dummy variable "i". How can we perform this search in Mathematica?? LP