2
$\begingroup$

I have a list

lista={a1,a2,a3,a4,a5,a6,a7,a8,a9}

I'm trying to get the arithmetic progression using Solve with the following rules:

Solve[a3+a6==34&&a4+a9==50, {a1,a2,a3,a4,a5,a6,a7,a8,a9}]

Is there anything smarter to apply?

$\endgroup$
  • 1
    $\begingroup$ There are conditions missing in order for this to be an arithmetic progression. They should be added to the equations. $\endgroup$ – Daniel Lichtblau Mar 15 '18 at 18:04
2
$\begingroup$
lista = NestList[# + r &, a1, 20 - 1]
Solve[lista[[3]] + lista[[6]] == 34 && 
   lista[[4]] + lista[[9]] == 50, {r, a1}] /. Rule -> Set
novalista = NestList[# + r &, a1, 20 - 1]
$\endgroup$
2
$\begingroup$

An arithmetic progression $\{a, a+d, a+2d, ...\}$ is defined by two terms, $a$ and $d$. So your problem is trivial:

Solve[(a + 2 d) + (a + 5 d) == 34 && 
      (a + 3 d) + (a + 8 d) == 50, 
 {a, d}]

{{a -> 3, d -> 4}}

lista = {3, 7, 11, ...}

$\endgroup$
1
$\begingroup$
apQ = Equal @@ Differences @ # &;

lista /. Solve[a3 + a6 == 34 && a4 + a9 == 50 && apQ @ lista, lista][[1]]

{3, 7, 11, 15, 19, 23, 27, 31, 35}

FindSequenceFunction @ %

-1 + 4 #1 &

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.