## 1580 Reputation

19 years, 250 days

## Try:...

L := ifactors(10^128+3, easyfunc);
remove(type, L[2], [prime, posint]);

## Don't use convert, rational...

A := 3.123123;
L := convert(A, confrac, 'Ac');
Ac;
evalf(Ac[-3], 32);

B := 3.123123123123;
L := convert(B, confrac, 'Bc');
Bc;
evalf(Bc[-2], 32);

C := 7.421232323;
L := convert(C, confrac, 'Cc');
Cc;
evalf(Cc[-3], 32);

## Yes, use select....

A := {1, 2, 3, 4, 6, 8, 12, 17, 19, 20};
select(is, A , RealRange(5, 15));
select(proc(x, y, z) x>=y and z>=x end, A, 5, 15);

## Use FormalPowerSeries....

A := x*y/(y-x*sqrt(y)-x^2);
(simplify@@2)(A, [y = sq^2]) assuming sq>0;
A_PS := convert(%, FormalPowerSeries, x);
B := op(1, A_PS);
simplify(B) assuming sq>0, k, nonnegint;
subs(sq=sqrt(y), %);
;

## Simple collection method....

assign('Q = Q, R = R');
collect(collect(A, epsilon, Q), Q, proc(x) if type(x, identical(epsilon)^anything) then R(epsilon, op(2, x)) elif type(x, identical(epsilon)) then R(epsilon, 1) else x fi end);
seq(eval(P = coeff(%, P), [Q = (x -> x), R = ((x, y) -> x^y)]), P = sort([op@indets](%, 'R(identical(epsilon), anything)'), ((x, y) -> (op(2, x) < op(2, y)))));

## Use coeffs and member....

F := 2*y*sin(beta*x)+6*z*cos(beta*x)+24*sin(beta*x)*cos(beta*x):
W := coeffs(F, {sin, cos}(beta*x), 'V'):
[W], [V];
if member(sin(beta*x), [V], 'i') then op(i, [W]) else 0 fi;
if member(cos(beta*x), [V], 'i') then op(i, [W]) else 0 fi;

## Poor coding....

Replace relevant lines (from Eq3..Sols) with:
Eq3 := factor(expand(value(algsubs(subs(params, tr3), Eq2))))
Eq31 := collect(numer(lhs(Eq3)), exp(z))
sys1 := [coeffs(Eq31, exp(z)), c=c0];
vars := indets([sys1], name) minus {c0};
Sols := map(allvalues, [solve(sys1, vars)]); NSols := nops(Sols);

Alternatively you can try:
Eq3 := factor(expand(value(algsubs(subs(params, tr3), Eq2))))
vars := {c, mu, seq(a[i], i = -1 .. 1), seq(b[j], j = -1 .. 1)}
Sols := map(allvalues, [solve]({c=c0, identity(Eq3,z)},vars)); NSols := nops(Sols);

## ListTools[Categorize]...

Q:=proc(E)
local X;
if type(E, `+`) then X := [op]('E') else X := ['E'] fi;
ListTools:-Categorize(proc(x, y) lcoeff(x) = lcoeff(y) end, X);
end;
Q(pn);

## mhypergeom...

Have you tried looking at:

dsolve(ode, y(x), 'formal_solution', 'coeffs' = 'mhypergeom');

## Expand....

After You've assigned Leq add this line:
Leq := expand(Leq):

## Use sparsematrixplot....

Q:=map(x->`if`(type(x,even),1,0), LinearAlgebra:-RandomMatrix(3,3));
plots[sparsematrixplot](Q, matrixview);

d1 := LinearAlgebra:-Determinant(A):