Do any integers occur in both sequences?

Leroy Quet qq-quet at mindspring.com
Tue Jul 31 16:18:48 CEST 2007


says (near top):
  Number of sequences of length n-1 consisting of positive integers
  such that the opening and ending elements are 1 or 2, and the
  absolute difference between any 2 consecutive elements is 0 or 1.
 A024537 ,1, 2, 4, 9, 21, 50, 120, 289, 697, 1682 (=?= A018905)
     [1,] 1, 2, 4, 9, 21, 51, 127, 323,
Return-Path: <maxale at gmail.com>
X-Ids: 168
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=eTM4iBw1Lnw+heXqYO8NGWJOVgYMGpoGs2s4hikTJbo88kRHfaMa2ZhX2vnMly81mwHE4xpJR6C0Ka82cAUpIMg94YlDZnhtecWVoYAenHs80zWIGNUlZrQriVw6qgGjZrJvPY9lzK7Dm2RN4gKI4FJ1tv5EDmfW2HYAuL+HS8A=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=dLvpK8Vovl94Tqxqr/Fp63Nx+oyMfEEBd077JZwlJsnTX4S6yC1hgY2lNm0mA4feEJ7yDuCXmT5htNfBd7Em3eRmNBf2Cv4p0qmPJfP6vGooaHplKRosADj5xspUYpRiKE7arLf6A1F/hGK4ueQMCCEKo6pTSOU87XNt932u7eo=
Message-ID: <d3dac270707311050nef0feeeh112abf67f3192e89 at mail.gmail.com>
Date: Tue, 31 Jul 2007 10:50:49 -0700
From: "Max Alekseyev" <maxale at gmail.com>
To: "Joerg Arndt" <arndt at jjj.de>
Subject: Re: possibly wrong comment with Motzkin numbers
Cc: seqfan at ext.jussieu.fr
In-Reply-To: <20070731152620.GA6791 at amd32.purzl.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20070731152620.GA6791 at amd32.purzl.net>
X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-3.0 (shiva.jussieu.fr [134.157.0.168]); Tue, 31 Jul 2007 19:50:51 +0200 (CEST)
X-Virus-Scanned: ClamAV 0.88.7/3835/Tue Jul 31 15:59:27 2007 on shiva.jussieu.fr
X-Virus-Status: Clean
X-j-chkmail-Score: MSGID : 46AF767A.001 on shiva.jussieu.fr : j-chkmail score : X : 0/50 1 0.510 -> 1
X-Miltered: at shiva.jussieu.fr with ID 46AF767A.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)!

On 7/31/07, Joerg Arndt <arndt at jjj.de> wrote:
> A comment with seq A001006
> http://www.research.att.com/~njas/sequences/A001006
> says (near top):
>   Number of sequences of length n-1 consisting of positive integers
>   such that the opening and ending elements are 1 or 2, and the
>   absolute difference between any 2 consecutive elements is 0 or 1.
>
> This seems to be wrong, I get the counts
>  A024537 ,1, 2, 4, 9, 21, 50, 120, 289, 697, 1682 (=?= A018905)
>
> Note the starts math, Motzkins start as
>      [1,] 1, 2, 4, 9, 21, 51, 127, 323,

With a simple recurrence formula implementation in PARI/GP, I confirm
that the comment in A001006 is correct:

{ a(n,l) = if(n==1,(l==1)||(l==2),if(l<=0,0,a(n-1,l-1)+a(n-1,l)+a(n-1,l+1))) }

{ f(n) = a(n,1)+a(n,2) }

? vector(10,n,f(n))
%1 = [2, 4, 9, 21, 51, 127, 323, 835, 2188, 5798]

Here a(n,l) counts the number of sequences of positive integers of
length n, starting with 1 or 2 and ending with l.

Max






More information about the SeqFan mailing list