Help with seq cmd

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Help with seq cmd

Message par compsystems » ven. août 24, 2018 1:17 am

Hello for the sequence { 2, 9, 16, 23, 30, 7, 14, 21,28 } is encoded as CONCAT(seq(k,(k=2 .. 30),7), seq(k, (k=7 .. 31),7));

but for this it is possible using SEQ or functional cmd (makemat, etc)?

{1,1,2,3,5,8,13,21}

Starting with the third number in the list, the 2, each number is obtained by adding the two previous numbers of the list. That is, 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5,

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Help with seq cmd

Message par parisse » ven. août 24, 2018 6:33 am

If the question is generate a Fibonacci sequence with a single seq command, I would say that you must enter the formula (obtained with rsolve for example). Maybe someone can find an astucious way to generate it, but this will probably be complicated or inefficient or both. It is much better to write a loop that is easy to write, understand and is efficient...

Répondre