Tagged Questions

Questions on the number-theoretic functionality of Mathematica.

71 views

Efficiently checking whether a number is a perfect power

Goal The goal is to efficiently check whether a number is a perfect power. Attempts It is possible to check whether a number is a perfect power using ...
179 views

Truncate an infinite continued fraction at order 2000

I want to solve an equation which contains an infinite continued fraction $F(n)$. Then I must (obviously) truncate this continued fraction at $n=2000$. The problem here is that Mathematica does not ...
56 views

Rationalize error

The docs state that "Rationalize[x,dx] yields the rational number with smallest denominator that lies within dx of x." However, testing this out it appears to be false. ...
38 views

Montgomery Modular reduction

I saw a Mathematica Implementation of Montgomery reduction at Montgomery Modular Exponentiation, a beautiful one by Simon Woods. I ran this in Mathematica and it was fast, but it does not give the ...
114 views

Check Zagier theorem about Mahler's measure

I want to check the following theorem by using Mathematica: (from Heights of Polynomials and Entropy in Algebraic Dynamics, page 22) $\textbf{Theorem}.$ Let $\omega$ denote a primitive $6th$ ...
68 views

...
62 views

Working with large integers in Modular Arithemetic

What would be the most efficient method of finding the remainder of the following division, 2^(2^330000000 - 1)/(2^330000001 - 1). I have tried using PowerMod function in Mathematica but i did not get ...
61 views

...
330 views

Finite Field matrix rank calculation

How does one define a matrix over $\mathrm{GF}(p^r)$ in Mathematica in order to compute rank? I am working with $\mathrm{GF}(2)$?
90 views

Factor a polynomial Root into Roots of smallest possible degree

Suppose I have a polynomial Root representing an algebraic number. I want to represent it (if possible) as a product of several polynomial ...
599 views

Why is my solution to PE #5 so slow

I'm new to Mathematica and it was suggested to me to go through the Project Euler problems in order to learn it. However, I can't quite figure out why my solution to #5 is so slow. The problem: ...
71 views

Numerical testing of Hardy's inequality

I want to check the following, Hardy's most fundamental inequality, by using Mathematica: $$\sum_{n=1}^\infty \left(\frac{A_n}{n}\right)^p<\left(\frac{p}{p-1}\right)^p\sum_{n=1}^\infty a_n^p$$ ...
154 views

Miller-Rabin algorithm [closed]

I want to implement the Miller-Rabin algorithm in Mathematica to check if a number is prime with at least 99.99% probability. I used this: ...
348 views

Why is Mathematica getting this modular root wrong?

First, note that $4^{96}\equiv 96 \pmod {100}$. Mathematica claims that PowerMod[96, 1/96, 100] has no integer solutions. Even more obviously wrong, I get ...
61 views

Get Mathematica to solve Modular Arithmetic problem [closed]

How would I get Mathematica to solve something like this for $x$? $4x \equiv 1 \pmod 5$
63 views

How can I implement Jordan's totient function?

How can I implement Jordan's totient function? It is a generalization of Euler's Phi function.
187 views

Visualisation of the field of algebraic numbers in the complex plane

Hot to plot the field of algebraic numbers in the complex plane? In this picture, the color of a point indicates the degree of the polynomial of which it’s a root: red = rational numbers ...
47 views

Efficiently create a list of factors of consecutive integers

I'm interested in a scalable (read: sublinear) algorithm for producing the list of integer factors of each integer from 1 to n. ...
64 views

Are there any Mathematica programs on or about the LMFDB Archive?

I would like to explore the LMFDB Archive with L-functions using Mathematica. Is there any Mathematica sample code available to get me started?
135 views

Is it better to completely forget about the existence of PowersRepresentations?

I noticed that in several cases the performance of PowersRepresentations is hugely worse than that of IntegerPartitions. (Mma 10....
94 views

FrobeniusSolve: how does it work?

Can someone suggest any reference to read? I would like to understand how the algorithm works.
212 views

89 views

Faster square test for integers

This question was asked already in Jan '12 and the most recent answer is from Oct '12, so it's several Mathematica versions out of date. What is a faster test for whether an integer is a perfect ...
48 views

LatticeReduce question

Does LatticeReduce work with arbitrary precision arithmetic? That is, if I give it a linearly independent integer basis, but the integers are 40 decimal digits long ...
44 views

Coppersmith's algorithm like Pari's zncoppersmith?

Is there some Mathematica package (or built-in that I missed) available, more or less equivalent to Pari's zncoppersmith function? Paraphrasing that source: given ...
133 views

Finding vector of same direction with smallest integer coordinates

To determine Miller Indices of crystal lattice planes I would need a stable algorithm which determines the smallest set of integer coordinates of a vector which has same direction as a given vector (e....
76 views

Why does this function return the largest integer less than or equal to √n?

I've been asked this question by my teacher. The function I'm talking about is the following: ...