[seqfan] Re: funny recursion producing a known table
Wouter Meeussen
wouter.meeussen at telenet.be
Sat Apr 27 01:40:02 CEST 2013
hmm,
say T(n,k) is 0 for all n<=0 and for all (n+k) odd, but with an overriding
T(0,0)=1
then T(n,k) = if( k=0, then T(n,k) = sum( m= 0 .. n, T(n/2,m) ;
else T(n,k) = T(n-1,k-1) + T(n-2*k,k) ) (*endif*)
that is not exactly English, but close, I hope.
'pardon my French' ;-))
Wouter.
-----Original Message-----
From: Neil Sloane
Sent: Saturday, April 27, 2013 1:25 AM
To: Sequence Fanatics Discussion list
Subject: [seqfan] Re: funny recursion producing a known table
I am sure I am the only one has this problem, but I find Mathematica code
impossible to read.
In the old days one would say: Define T(n,k) to be this if ... or that if
...
English is a rough approximation to a universal language, not so Mma.
On Fri, Apr 26, 2013 at 5:52 PM, Wouter Meeussen <wouter.meeussen at telenet.be
> wrote:
> hi All,
>
> try this one out:
>
> Clear[T];
> T[0, 0]:= 1;
> T[n_, k_]:= 0 /; ( n<= 0|| OddQ[n +k] ); (* aerated triangular table *)
> T[n_, k_]:=T[n, k]= If[ k==0, Sum[ T[ n/2, m],{m, 0, n}], T[n -1, k
> -1]+ T[ n- 2*k ,k] ];
>
> (* and then show it using *) Table[T[n, k], {n, 0, 12}, {k, 0, n}]
>
> The fun is in the surprising row sums and the familiar columns down to the
> diagonal :
> why does such a silly "T[n -1, k -1]+ T[ n- 2*k ,k] " produce this cute
> result (from Wolfdieter Lang)?
>
> And what on earth does it have to do with its GF? (from Emeric Deutsch)
> GF : 1/ Product[ (1-t*x^(2*j-1)) * (1-x^(2*j) )
>
> hope the Mathematica code is readable to all,
> enjoy,
>
> Wouter.
>
> ______________________________**_________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>
--
Dear Friends, I have now retired from AT&T. New coordinates:
Neil J. A. Sloane, President, OEIS Foundation
11 South Adelaide Avenue, Highland Park, NJ 08904, USA
Phone: 732 828 6098; home page: http://NeilSloane.com
Email: njasloane at gmail.com
_______________________________________________
Seqfan Mailing list - http://list.seqfan.eu/
More information about the SeqFan
mailing list