[seqfan] Re: funny recursion producing a known table
Neil Sloane
njasloane at gmail.com
Sat Apr 27 01:25:22 CEST 2013
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
More information about the SeqFan
mailing list