# [seqfan] Re: A158415

Robert Gerbicz robert.gerbicz at gmail.com
Sun Mar 22 13:00:14 CET 2009

```2009/3/22 Vladimir Reshetnikov <v.reshetnikov at gmail.com>

> Dear all,
>
> Can anybody suggest an algorithm for calculating the terms of A158415?
>
> Thanks
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>

Hi!

There are two possibilities for N symbols: u=sqrt(x) where x is using N-1
symbols, or u=x+y where x is using 1<=j<N and y is using 1<=N-1-j<N symbols.
Extension of the sequence (I've already submitted):
1,1,2,3,5,8,13,20,33,54,91,154,264,455,791,1379,2424,4277,7588,13513,
24162,43336,77978,140683,254487,461409,838433,1526536

A quick PARI-Gp code for it:
allocatemem(2*10^8);\
a=L=vector(28);eps=10^(-20);a[1]=[1];L[1]=1;print1(1",");\
for(i=2,28,b=vector(L[i-1]+sum(j=1,(i-1)\2,L[j]*L[i-j-1]));\
up=0;for(j=1,L[i-1],up++;b[up]=sqrt(a[i-1][j]));\
for(j=1,(i-1)\2,for(k=1,L[j],for(l=1,L[i-1-j],\
up++;b[up]=a[j][k]+a[i-1-j][l])));\
c=vector(up,j,b[j]);c=vecsort(c);s=0;\
for(j=1,up,if((j==1)||(c[j]>c[j-1]+eps),s++));\
a[i]=vector(s);s=0;\
for(j=1,up,if((j==1)||(c[j]>c[j-1]+eps),s++;a[i][s]=c[j]));\
L[i]=s;print1(L[i]","))

```