Skip to main content
29 votes

Code I get from wolfram isn't working in mathematica

You can chalk this up as a W|A bug. We do indeed try to factor with the approach stated by OP. When that times out, we try a different approach, but fail to update the code provided to the user. The ...
Greg Hurst's user avatar
  • 36.3k
17 votes
Accepted

Code I get from wolfram isn't working in mathematica

I believe your question is completely valid and I gave it a big upvote. Assuming that WolframAlpha did indeed use this command to get the result, I'm not sure on what mystical machine they ran it on. ...
halirutan's user avatar
  • 113k
14 votes
Accepted

Automating interesting ways to write 2023

I would like to point out FrobeniusSolve, e.g. this yields nonnegative solutions $(x_1,x_2)$ of this equation $20 x_1 +23 x_2 =2023$ ...
Artes's user avatar
  • 57.5k
12 votes

Why Mathematica can not factorize polynomials over algebraic fields?

...
chyanog's user avatar
  • 15.6k
12 votes

Automating interesting ways to write 2023

Happy new year! IntegerDigits[2023, 2] {1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1} Edit: another interesting way ...
bmf's user avatar
  • 16.1k
11 votes
Accepted

Factor a bivariate polynomial treating one variable as constant

Although there might be various approaches, it seems that proceeding the most obvious one should be good enough We have ...
Artes's user avatar
  • 57.5k
11 votes

Automating interesting ways to write 2023

I thought it could be nice to use different domains of Mathematica to represent 2023 in different ways. Outline: Entities Polynomial algebra Linguistic Data Number theory Text analysis Special ...
userrandrand's user avatar
  • 5,937
9 votes
Accepted

Collect/Factor a fraction

Consider your expression, expr = (a + m a + b + n b + c + k c + d + e)/(a b); This gets us almost where we want to go, ...
Jason B.'s user avatar
  • 68.9k
9 votes
Accepted

Factor a polynomial over the reals

One way is to find the roots, separate into real and complex, further separate the complex ones into conjugate pairs, then reform as a factorization (taking into account the leading coefficient). I'll ...
Daniel Lichtblau's user avatar
9 votes
Accepted

Checking whether one polynomial is a factor of another

how do I check if one polynomial is a factor of another in Mathematica? One possibility might be to use PolynomialRemainder ...
Nasser's user avatar
  • 146k
9 votes
Accepted

Factorize in a particular way

Try this: xvars={x1,x2,x3}; FromCoefficientRules[CoefficientRules[TestPolynomial,xvars]//Factor,xvars] This is based on the following interpretation of your ...
user293787's user avatar
  • 11.9k
9 votes
Accepted

Prime factors with multiplicity

Flatten@*MapApply[ConstantArray]@*FactorInteger
lericr's user avatar
  • 30.1k
8 votes

Factor a polynomial over the reals

My knowledge in this area is quite lacking, so there are probably better ways. The following function will force-factor anything, and will return Root objects if ...
Szabolcs's user avatar
  • 236k
8 votes
Accepted

Check if polynomial is in factored form, without factoring

You can check whether the Head of the expression is Plus, which is associated with a non-factored polynomial: ...
MarcoB's user avatar
  • 67.4k
7 votes

Factor a polynomial over the reals

Factor[x^4 + 17 x^2 + 12, Extension -> Sqrt[241]] (*-(1/4) (-17 + Sqrt[241] - 2 x^2) (17 + Sqrt[241] + 2 x^2)*) The answer to another example can be obtained ...
yarchik's user avatar
  • 19k
7 votes

Factorization of a polynomial fraction to a certain combinations of other polynomial fractions

Rewriting your definitions slightly ...
Sander's user avatar
  • 1,876
7 votes

Extract common factor from vector or matrix

A toy approach is as follows: ...
E. Chan-López's user avatar
7 votes
Accepted

Factoring expression with rational powers

How about that ...
Akku14's user avatar
  • 17.3k
7 votes
Accepted

Efficient code for minimum integer with given number of factors

Note that the divisor count function of a number with prime factorization $$n=p_1^{a_1} p_2^{a_2} \cdots p_i^{a_i}$$ satisfies: $$\tau (n)=\prod _k^i \left(a_k+1\right)$$ So, to find an inverse of ...
Carl Woll's user avatar
  • 131k
7 votes

Efficient code for minimum integer with given number of factors

If a number $n$ has $k$ divisors, then $k=(a_1+1)(a_2+1)\ldots (a_m+1)$, where the prime factorisation of $n=p_1^{a_1} p_2^{a_2}\ldots p_m^{a_m}$, as @CarlWoll points out. Therefore, $k$ must be the ...
KennyColnago's user avatar
  • 15.3k
7 votes

Factor not factoring quadratic polynomial

If you want irrational coefficients, you need to tell it which numbers to use as an extension of the rationals. ...
John Doty's user avatar
  • 13.8k
7 votes
Accepted

Split Expression Into Constant And Non-Constant Summands

I hope this works. It was awkward to construct and I've tested it for a number of cases: ...
flinty's user avatar
  • 25.5k
7 votes
Accepted

How to prime factorise rational numbers

If I look at https://reference.wolfram.com/language/ref/FactorInteger.html and I click on the orange Details and Options then I see FactorInteger also works on rational numbers. The prime factors of ...
Bill's user avatar
  • 12.2k
7 votes
Accepted

How to get the analytical form of a solution to an algebraic equation?

Using answer in Solving quintic in radicals QuinticToRadicals[sol[[1]]] gives Full code (see post above) ...
Nasser's user avatar
  • 146k
6 votes
Accepted

Powers of prime factors of a positive integer $n$ in "Mathematica"?

If you really mean, as you say, that $n$ and $p$ are given, so you could simply use IntegerExponent[n,p].
KennyColnago's user avatar
  • 15.3k
6 votes
Accepted

Factorize expression into matrix/vector operations if possible

I just wrote a package to do matrix differentiation to answer question (138708). The package can be obtained from: https://github.com/carlwoll/MatrixD/releases. Download the file "MatrixD-1.0....
Carl Woll's user avatar
  • 131k
6 votes

Why Mathematica can not factorize polynomials over algebraic fields?

This is far from a complete answer but it does contain parts of a general method. The idea is to do it numerically, using a univariate factorization with specific values plugged in for two variables, ...
Daniel Lichtblau's user avatar
6 votes

Why Mathematica can not factorize polynomials over algebraic fields?

It is an input processing issue. Factor uses the extension generated by the algebraic numbers specified through the Extension option and algebraic numbers it finds in the coefficients of the input ...
Adam Strzebonski's user avatar
6 votes

Automating interesting ways to write 2023

According to the Goldbach conjecture, 2023 can be written as a sum of 3 primes... we can find these using: ...
bill s's user avatar
  • 69.2k
6 votes
Accepted

Factor gives non-factorized result

I think the confusion that Factor encounters is that the sum has trig. functions in it. Since the default option is ...
Michael E2's user avatar
  • 237k

Only top scored, non community-wiki answers of a minimum length are eligible