# Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

286 questions
Filter by
Sorted by
Tagged with
1answer
117 views

### Question about PrimeZetaP

The PrimeZetaP function appears to give results for complex s with real part > 0. Apparently, the analytic continuation is built ...
2answers
184 views

### Solving problem using recursive functions

Attached below is a question posed by the Canadian Mathematical Society, and I have my code and answer. Is there a better way of writing the code, and will the answer be different as a result? My ...
1answer
394 views

### Smallest integer that does NOT divide a given number

Divisible[n,m] yields True if n is divisible by m, and yields False if it is not. My query ...
2answers
421 views

### Pollard's Rho algorithm

I'm working in Mathematica and I'm trying to implement the [Pollard's Rho Algorithm for the Discrete Logartihm Problem].
1answer
69 views

### Non-integral common denominator

I have a list r = {114.49, 311.876, 538.704} whose elements are multiples of a non-integer value. I want to find the common denominator ...
1answer
454 views

### How can I plot the normalized distribution of the Riemann zeta zeros?

Given a list of eigenvalues or a list of Riemann zeta zeros, how can I plot this famous plot found here: On the page referred to, You need to click on "Programs", "The Riemann zeta function" and "...
5answers
523 views

### Prime factorization

I am trying to find a code that will output the prime factor decomposition of a number but for some reason I keep getting error messages. It is supposed to output the exponent of 2 and the odd factor. ...
1answer
1k views

### Fast calculation of discrete logarithms

Does Mathematica have any built-in fast algorithms for calculating discrete logarithms over $(\mathbb{Z}_p)^\times$ (the group of integers modulo $p$)? Essentially, for a fixed large prime ...
2answers
247 views

### Can anyone re-produce this result related to the spectrum of Riemann Zeta using error term generated from MangoldtLambda?

All: I tried to reproduce the results from this page: How to plot the Riemann-Zeta zero spectrum The following is the code that was posted on above page: ...
2answers
184 views

### Find the maximum Z in {(X + Y)==Z} using all the digits 0-9 only once

II want to add two integers with different digits to get a third integer with different digits. At the end, all 10 digits have to be different. So there should be 10 digits in total. How you ...
4answers
374 views

### How can I write the natural numbers less than $n$ that are coprime to $n$? [duplicate]

How can I write the natural numbers less than $n$ that are coprime to $n$?
2answers
129 views

### How to efficiently find all sets of primes that add to a given number?

For large numbers the naive approach falls down: Select[Subsets[Range[1, 4]], PrimeQ@Total@# &] {{2},{3},{1,2},{1,4},{2,3},{3,4},{1,2,4}} ...
0answers
247 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-...
1answer
128 views

### Range of summation in simple Plot seems off

I was trying to reproduce a picture in a book by Havil of the sum, $$s = \sum_{r=1}^{\infty}\frac{\mu(r)}{r}\left(Li(x^{\rho_k/r})+Li(x^{\rho_k*/r})\right)$$ using ...
1answer
188 views

### High precision calculation of infinite product involving prime numbers

I'm recently studying some topics in analytic number theory and I have encountered results involving the infinite product $$C=\prod_{p}\left(1-\frac{1}{p(p+1)}\right)$$ where $p$ denotes calculating ...
3answers
565 views

### Speeding up the built-in Rudin-Shapiro and Thue-Morse sequence functions

Version 10.2 introduced two well-studied sequences as functions: the (Golay-)Rudin-Shapiro sequence (RudinShapiro[]) and the (Prouhet-)Thue-Morse sequence (...
0answers
45 views

3answers
688 views

### Better answer to Santa's riddle about sum of a number's divisors?

I was hoping to find an elegant solution to this riddle, using only a line or two of Mathematica: Santa Claus was telling one of his elves: "If I multiply the age of three of my reindeer, I get ...
1answer
391 views

### Factoring an ideal in a number field into prime ideals

I'd like to factor an ideal in a number field into prime ideals, exactly as in this example from the Sage documentation: ...