0
$\begingroup$

I need to use the coefficients T(n,k) in my algorithm and I found a program in PARI

Can anybody translate this code to mathematica?

{T (n, k) = 
if (n == 0, 1, 
if (k == 0, 1, 
  if (k == n, 3^n*(3^n - sum (j = 0, n - 1, T (n, j)/3^j)), 
    polcoeff ((Ser (vector (n, i, T (n - 1, i - 1)), x) + 
         x*O (x^k))^((n + 1)/n), k, x))))}
$\endgroup$
  • $\begingroup$ If you are planning on using Mathematica a lot, then this is a great exercise to do yourself. I really think it's worth sitting down and trying to figure this out on your own. $\endgroup$ – march Apr 5 '17 at 22:44
  • $\begingroup$ i tried, but I have some problems with Ser,vector part... $\endgroup$ – J42161217 Apr 5 '17 at 22:46
  • $\begingroup$ Well, I can't help you with that, because I don't know PARI syntax. Perhaps you should edit your post to include what you have so far, and someone might be able to help. $\endgroup$ – march Apr 5 '17 at 22:51
  • $\begingroup$ Probably better off to start from the math; that is, where did you get this code from? Can you describe what you're trying to compute here? $\endgroup$ – J. M. will be back soon Apr 5 '17 at 22:54
  • 3
    $\begingroup$ Try this: Table[SeriesCoefficient[3 y/((1 - 9 x y) + (3 y - 1)*(1 - 9 x y)^(2/3)), {x, 0, j}, {y, 0, k}], {j, 0, 8}, {k, 0, j}]. (I used the generating function given there.) $\endgroup$ – J. M. will be back soon Apr 5 '17 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.