# Tag Info

### 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 ...
• 36.3k
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. ...
• 113k
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$ ...
• 57.5k

...
• 15.6k

### 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 ...
• 16.1k
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 ...
• 57.5k

### 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 ...
• 5,937
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, ...
• 68.9k
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 ...
• 59.3k
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 ...
• 146k
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 ...
• 11.9k
Accepted

### Prime factors with multiplicity

Flatten@*MapApply[ConstantArray]@*FactorInteger
• 30.1k

### 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 ...
• 236k
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: ...
• 67.4k

### 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 ...
• 19k

• 1,876

### Extract common factor from vector or matrix

A toy approach is as follows: ...
• 25.7k
Accepted

• 17.3k
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 ...
• 131k

### 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 ...
• 15.3k

### 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. ...
• 13.8k
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: ...
• 25.5k
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 ...
• 12.2k
Accepted

• 146k
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].
• 15.3k
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....
• 131k

### 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, ...
• 59.3k

### 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 ...
• 3,520

### 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: ...
• 69.2k