[seqfan] Re: Two neighbors sum -- and odd ranks in S

Neil Sloane njasloane at gmail.com
Wed Oct 22 14:59:33 CEST 2014

```Nice sequence! But I see that there are two competing programs which -
looking at the history - appear to give different results?

That is not good! Which program is correct?  Or am I misunderstand the
history?

Can someone produce a b-file?

Best regards
Neil

Neil J. A. Sloane, President, OEIS Foundation.
11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
Email: njasloane at gmail.com

On Tue, Oct 21, 2014 at 11:03 PM, M. F. Hasler <oeis at hasler.fr> wrote:

> Eric,
>
> congratulations on this interesting if not fundamental non-base
> sequence which definitely was missing in the OEIS.
>
> I would however suggest a little re-indexing; since you consider
> nonnegative integers, indices should IMHO also start with n=0: Then we
> really have a permutation in the sense of bijective map from {0,1,...}
> into itself, and the relation becomes even simpler & more natural,
> a(2n)=a(n)+a(n+1), n=0,....
>
> My little program* confirms your data (at first sight :)).
> I submit the proposal as https://oeis.org/draft/A249129
>
> Best wishes,
> Maximilian
>
> {a=vector(200);a[1]=1;a[3]=2;u=7;for(n=4,#a, a[n]=if( n%2,
> a[n\2+2]+a[n\2+1], k=2; while(bittest(u,k++),); u+=1<<k; k);
> u=bitor(u,1<<(a[n-1]+a[n])); n<#a && a[n+1] &&
> u=bitor(u,1<<(a[n+1]+a[n])));a}
>
> 1, 0, 2, 3, 5, 4, 8, 6, 9, 7, 12, 10, 14, 11, 15, 13, 16, 17, 19, 18,
> 22, 20, 24, 21, 25, 23, 26, 27, 28, 30, 29, 31, 33, 32, 36, 34, 37,
> 35, 40, 38, 42, 39, 44, 41, 45, 43, 46, 47, 48, 50, 49, 51, 53, 52,
> 55, 54, 58, 56, 59, 57, 60, 61, 64, 62, 65, 63, 68,...
>
> Check with rule : a(n)+a(n+1)=a(2n), n=0,....
> a(0)=0 + a(1)=1 = 1 =?= a(2*0) no.
> a(0)=1 + a(1)=0 = 1 =?= a(2*0) yes.
> a(1)=0 + a(2)=2 = 2 =?= a(2*1) yes.
> a(2)=2 + a(3)=3 = 5 = a(4) ok
> a(3)=4 + a(4)=5 = 9 = a(6) ok
> ...
>
>
>
> On Tue, Oct 21, 2014 at 3:58 PM, Eric Angelini <Eric.Angelini at kntv.be>
> wrote:
> >
> >
> > Hello SeqFans,
> > S is the lexically first permutation
> > of the Natural numbers such that
> > a(n)+a(n+1)=a(2n-1)
> > S =
> 1,0,2,3,5,4,8,6,9,7,12,10,14,11,15,13,16,17,19,18,22,20,24,21,25,23,26,27,28,30,29,31,33,32,36,34,37,35,40,38,42,39,44,41,45,43,46,47,48,50,49,51,53,52,55,54,...
> >
> >
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>

```