Message Boards Message Boards

NSolve won't execute

Posted 3 days ago

I see my error.

Thanks,
Leon

POSTED BY: Leon Fairbanks
3 Replies

You forgot to insert a conjunction between S18[10] and S18[11]. Replace comma with &&. You may also exclude a1 from the list of unknowns.

S18[n_] := 
     1/a1 (a10 2^(18 n - 18) + a9 2^(16 n - 16) + a8 2^(14 n - 14) + 
        a7 2^(12 n - 12) + a6 2^(10 n - 10) + a5 2^(8 n - 8) + 
        a4 2^(6 n - 6) + a3 2^(4 n - 4) + a2 2^(2 n - 2));
NSolve[S18[2] == 512 && S18[3] == 32276480 && 
  S18[4] == 5967012429824 && S18[5] == 1434047386279215104 && 
  S18[6] == 367859068909182204772352 && 
  S18[7] == 95910600411254377903510519808 && 
  S18[8] == 25108333074341105474794741072658432 && 
  S18[9] == 6579768945390796136704466286370881536000 && 
  S18[10] == 1724700842014699584005152525604862865902141440 && 
  S18[11] == 452110402686837008940790840661958866701897063989248, {a2, a3, a4, a5, a6, a7, a8, a9, a10}, Integers]

You can use also Reduce[] function:

In[1]:= s18[n_] := 
1/a1 (a10 2^(18 n - 18) + a9 2^(16 n - 16) + a8 2^(14 n - 14) + 
a7 2^(12 n - 12) + a6 2^(10 n - 10) + a5 2^(8 n - 8) + 
a4 2^(6 n - 6) + a3 2^(4 n - 4) + a2 2^(2 n - 2))



In[2]:= Reduce[
s18[2] == 512 && s18[3] == 32276480 && s18[4] == 5967012429824 && 
s18[5] == 1434047386279215104 && 
s18[6] == 367859068909182204772352 && 
s18[7] == 95910600411254377903510519808 && 
s18[8] == 25108333074341105474794741072658432 && 
s18[9] == 6579768945390796136704466286370881536000 && 
s18[10] == 1724700842014699584005152525604862865902141440 && 
s18[11] == 
452110402686837008940790840661958866701897063989248, {a1, a2, a3, 
a4, a5, a6, a7, a8, a9, a10}, Integers] /. 
a1 -> 109395*70945875*638512875*2338875*1488375*49116375*30405375*\
425675250*10854718875

Out[2]= (a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9 | a10) \[Element] 
Integers && 
a2 == 178282935567271856830509942680720274438676605292968750000000000\
00000 && 
a3 == 136156643654118251436525836319588715317466888235467529296875000\
00000 && 
a4 == 111536831530413524163808099074400549387026854019371795654296875\
00000 && 
a5 == 809677853005611016306812369252803030577856150916344642639160156\
2500 && a6 == 
5010752484776427247876881679510552148398313965147862434387207031250 \
&& a7 == 
2535507653513230338348779077835354575248482195101289749145507812500 \
&& a8 == 
983483218762795551135714248560863732627156343337717056274414062500 &&
a9 == 25995043117205830436081336726502026767857373030219316482543945\
3125 && a10 == 
35117979774198190374919205068343776102717455854172706604003906250
Attachments:

Thanks Valeriu!

POSTED BY: Leon Fairbanks
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract