Message Boards Message Boards

Replacement of SymmetricGroupIndex result with input in second program

Posted 1 year ago

I have Mathematica Home Edition 13.1 running on a Mac OS X Arm (64-bit) platform. The result of the first program appears in the denominator of the line in the second program beginning with "X[y_] = ". When I replace this denominator with the second input line of the first program, the program no longer works. I would like to combine these two programs into one, but apparently I don't have a good handle on the timing of the replacement. It seems to get deferred and then the program hangs.

In[1] = mc = 5;
        SymmetricGroupIndex[mc, x] /. x[i_] -> If[i == 1, y, rp[i]]

Out[2] = y^5/120 + 1/12 y^3 rp[2] + 1/8 y rp[2]^2 + 1/6 y^2 rp[3] + 
         1/6 rp[2] rp[3] + 1/4 y rp[4] + rp[5]/5

In[3] = digits = 17; mc = 5; (* mc=maximum children *)m = 2 digits + 10; 
        b[n_, i_, t_, k_] := b[n, i, t, k] = If[i < 1, 0, 
          Sum[Binomial[b[i - 1, i - 1, k, k] + j - 1, j]*
          b[n - i*j, i - 1, t - j, k], {j, 0, Min[t, n/i]}]];
        b[0, i_, t_, k_] = 1;
        gf = 1 + Sum[b[j - 1, j - 1, mc, mc] x^j, {j, 1, m + 1}];
        g[r_] := Module[{rp, X, ym},
          For[k = 2, k <= mc, k++, rp[k] = gf /. x -> r^k]; 
          X[y_] = (y - 1)/(y^5/120 + 1/12 y^3 rp[2] + 1/8 y rp[2]^2 + 
            1/6 y^2 rp[3] + 1/6 rp[2] rp[3] + 1/4 y rp[4] + rp[5]/5); 
          ym = y /. FindRoot[X'[y] == 0, {y, 2}, 
          WorkingPrecision -> digits + 5]; X[ym]];
        rho = FixedPoint[g, 1/3, SameTest -> (Abs[#1 - #2] < 10^-digits &)]; 
        RealDigits[rho, 10, digits] // First

Out[4] = {3, 4, 0, 0, 1, 7, 4, 6, 9, 1, 5, 1, 0, 6, 0, 0, 8}
POSTED BY: Robert Russell
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract