Longest Lucas seq. from start to "n"

Max Alekseyev maxale at gmail.com
Thu Oct 18 15:07:27 CEST 2007


On 10/18/07, Maximilian Hasler <maximilian.hasler at gmail.com> wrote:

> The following PARI program displays this sequence :
>
> find(goal=17, mi=0, mx=0, new) =
> for(j=mi,goal,a=[goal,new=j];while(mi<=new=a[#a-1]-new,a=concat(a,new));if(#a>mx,mx=#a;maxa=a););
> [mx,maxa]
>
> one finds that the longest sequence is obtained by taking
>
> u(N-1) = round ( 2N / (sqrt(5)+1))

This is not true in general. We can say only that either u(N-1) =
floor( 2N / (sqrt(5)+1)) or u(N-1) = ceil( 2N / (sqrt(5)+1)). And
'round' cannot be used to select the correct value.

This is actually illustrated by your script:

> 12:[6, [12, 8, 4, 4, 0, 4]]

Here we have round( 2*12 / (sqrt(5)+1)) = 7 that gives a shorter sequence:

12, 7, 5, 2, 3

Max





More information about the SeqFan mailing list