We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

25 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
850 views

Does Mathematica use the Elliptic Curve Method (ECM) in FactorInteger[]?

I'm not a mathematician, and I'm not even going to pretend that I understand anything of the ECM. But I know it can be a fast method for factorization. I benchmarked the factorization of $$...
8
votes
1answer
222 views

Using Mathematica to find an alternative continued fraction for $\zeta(5)$

Given the Riemann zeta function $\zeta(n)$. I. $x=\zeta(3)$ Using Euler's continued fraction formula, we can form $\zeta(3)$'s cfrac as, $$Ax+B = \cfrac{1}{v_1 - \cfrac{1^6}{v_2 - \cfrac{2^6}{...
5
votes
0answers
102 views

Not comprehending PowerMod

Bug introduced in 10.3 or earlier and persisting through 11.3.0 or later The bug is not present in 10.0. By definition, PowerMod[a, 1/r, m] finds a modular rth root of a mod m. Here's a pair of ...
5
votes
0answers
250 views

Undocumented function SumOfSquaresReps

There is an interesting (and documented) number-theoretic function in MMA called PowersRepresentations[$n$, $k$, $p$]. It gives the distinct representations of the integer $n$ as a sum of $k$ non-...
5
votes
0answers
1k views

Elliptic curve cryptography in Mathematica

I can find no resources for doing elliptic curve cryptography. I have used the finite field package, but I find it cumbersome and it does not seem to have any builtin methods for ECC. How can I get ...
4
votes
0answers
119 views

Simplifying expressions involving Divisible

FullSimplify[ Divisible[p^2 - 1, 24] , Element[p, Primes] && p > 3] Should evaluate to True, but I get ...
3
votes
0answers
104 views

How to find, load and use a legacy Mathematica package

Question: How to find, load and use a legacy Mathematica package from a previous Mathematica version? What is the preferred approach and process? Context: I am working through a set of examples in ...
3
votes
0answers
98 views

Wrong divergence message for the continued fraction

Bug introduced in 8.0.4 or earlier and fixed in 11.2 Why there is an error message for ContinuedFractionK[k, 1, {k, Infinity}]? It is well known that, this ...
3
votes
0answers
137 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. ...
3
votes
0answers
118 views
3
votes
0answers
78 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?
3
votes
0answers
204 views

FrobeniusSolve: how does it work?

Can someone suggest any reference to read? I would like to understand how the algorithm works.
2
votes
0answers
36 views

FindEquationalProof to prove divisor theorem

I'm trying to implement proofs of concepts for Equational Proofs on some basic number theory theorems. One such example is: "let a and b be positive integers and let d = gcd (a, b). If t divides ...
2
votes
0answers
61 views

Introducing constraints in FrobeniusSolve

I have a knapsack problem. Say I have N possible items $x_i$. I would like to know: $ \sum_{i=0}^{2} c_i x_i = W$ With the following constraint: $c_i=3 \lor 4$ As an example suppose the set $x_i=...
2
votes
0answers
132 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$ root ...
2
votes
0answers
118 views

Approximate to the speed of Built-In functions

In Mathematica, there is a function PowerMod[a,b,m], which computes a^b mod m. I will concern only this case: ...
2
votes
0answers
370 views

Parallel PowerMod

Is there anyway to parallelize the PowerMod function? Here is my Left-To-Right modular exponentation: ...
2
votes
0answers
247 views

PowersRepresentations Algorithm

I'm trying to understand the mathematics behind counting the number of representations of a positive integer by $n$ distinct $k$th powers, i.e. I would really like to know how to do the Mathematica ...
1
vote
0answers
130 views

What is the shortest way to calculate Euler's Phi function ( excluding EulerPhi )?

With the risk of closure by the duplicate zombies ( this one might do: How can I write the natural numbers less than $n$ that are coprime to $n$? ) I dare to ask the following question. My hobby ...
1
vote
0answers
86 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 ...
0
votes
1answer
62 views

Finding the maximal number of lists that form certain rules?

I have the following example: data={1, 2, 3, 4, 5, 6, 7, 8, 9}; NN=Length[data]/3; subdata=Subsets[data, {3}]; I want to know all the possibility for the ...
0
votes
0answers
74 views

Find the maximum of a function involved with Floor function

My function is $$ f(H,p) = \left\lfloor \dfrac{\lfloor H/p\rfloor + 3 - \sqrt{(\lfloor H/p\rfloor + 1)^2 - 4H}}{2} \right\rfloor $$ The constraints are $ H \geq p(4p-1) $, $ p $ is prime although ...
0
votes
0answers
53 views

Question about how to use NestWhileList

I start with: n = 2228; m = n/2; PreviousPrime[n_] := NextPrime[n, -1] I use NestList to build the following list: ...
0
votes
0answers
59 views

MultiplicativeOrder understanding

According to specification, this should find the smallest integer $m$ such that $10^m \, mod \, 16 = 0$, or return unevaluated if there is no such integer. ...
0
votes
0answers
70 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 ...