Questions on the number-theoretic functionality of Mathematica.

learn more… | top users | synonyms

10
votes
1answer
140 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 ...
0
votes
0answers
44 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. ...
3
votes
0answers
56 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
74 views

FrobeniusSolve: how does it work?

Can someone suggest any reference to read? I would like to understand how the algorithm works.
15
votes
1answer
133 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 ...
7
votes
3answers
207 views

Find the number of $n$ such that $n!$ is a sum of three squares

I want to check the following theorem by using Mathematica: $\textbf{Theorem} $. $\text{The estimate}$ $\# \{n \le x:n! \text{ is a sum of three squares}\}=7x/8+O(x^{2/3})$ ...
3
votes
1answer
65 views

FindInstance only satisfies half of my double inequality

FindInstance[ 298973528525.436 < 10^10*(n - k*3.32192809488736) < 298973528539.862, {n, k}, Integers ] Result is: ...
0
votes
0answers
57 views

Factor Integer function with variable arguments

I'm trying to build a function that gives the highest power of a prime factor of a number. The following works perfectly: ...
2
votes
1answer
63 views

Twin Prime Max Gaps (Performance Tuning)

Ok, let's build a foundation here: A common way of testing primality, is dividing by all primes smaller than the number's square root. For instance, $97$ is prime because dividing by none of the ...
3
votes
2answers
163 views

Question about this Sieve of Eratosthenes graph

I googled for images of graphs and found nothing that even comes close to this one, so I want to experiment some more. ...
3
votes
1answer
18 views

What is the form of a PrimalityProving`PrimeQCertificate?

I understand the format of a proof of compositeness of an integer produced by PrimeQCertificate: it's well-documented that ...
4
votes
0answers
45 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 - ...
3
votes
1answer
75 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 ...
-5
votes
1answer
60 views

Finding a seven-digit number with all of its prime factors less than 20? [closed]

How can I find a seven-digit number with all of its prime factors less than 20? I have no clue how to do this.
3
votes
1answer
50 views

A function about prime gaps

I want to define a $f$ function on Mathematica such as this. $f[k]$ gives the smallest $m$ holds $2k=Prime[m+1]-Prime[m]$. For example, $$f[1]=2$$ $$f[2]=4$$ $$f[3]=9$$ $$f[4]=24$$ How can i do ...
0
votes
1answer
81 views

What is the smallest number that equals the sum of two cubes in two ways? [closed]

How does one find the smallest number that equals the sum of two perfect cubes(positive) in two ways?
4
votes
2answers
86 views

Goldbach Partition

I want to check the Goldbach conjecture for big number of $n$, but I don't know how to define this in Mathematica. There are my questions: Find a pair of primes $(p,q)$ for every even integer $n$, ...
1
vote
0answers
87 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 tha Mathematica does not ...
10
votes
2answers
930 views

Number of digits for factorial of 12345678987654321

What is the number of digits (IntegerLength) of the factorial of 12 345 678 987 654 321? The number of zeros at the end of this factorial was calculated and it is huge: exactly 3 086 419 746 913 569 ...
6
votes
1answer
87 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 ...
0
votes
0answers
47 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 ...
1
vote
0answers
43 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 ...
4
votes
2answers
128 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 ...
0
votes
1answer
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: ...
4
votes
1answer
84 views

Question about PrimeZetaP

The PrimeZetaP function appears to give results for complex s with real part > 0. Apparently, the analytic continuation is built ...
2
votes
2answers
166 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 ...
4
votes
1answer
115 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 ...
3
votes
2answers
197 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][1].
2
votes
1answer
48 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 ...
3
votes
1answer
125 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 ...
1
vote
5answers
364 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. ...
22
votes
1answer
323 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 ...
1
vote
1answer
91 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: ...
1
vote
2answers
164 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 ...
0
votes
4answers
138 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$?
-2
votes
2answers
105 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}} ...
2
votes
0answers
71 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$ ...
3
votes
1answer
108 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 ...
3
votes
1answer
122 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 ...
21
votes
2answers
415 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 (...
0
votes
0answers
40 views

How to print intermediate steps of simplifying a power formula? [duplicate]

To answer the question of proving Fibonacci sequence is periodic mod 5 without using induction., I came across Mathematica to prove $$F_{n}\equiv F_{n+20}\pmod 5$$ for all $n \geq 2$ I defined: ...
6
votes
3answers
252 views

On a strange pattern of triangular numbers in Ulam's spiral

In this MSE post, user GeMir noticed that, where the green dots are the triangular numbers, $$T_n = \frac{n(n+1)}{2} = 1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,\dots$$ in the Ulam spiral ...
0
votes
1answer
69 views

Write a function pollard[n, B] that tries to factor an integer n, using Pollard's p − 1 method with at most B iterations [closed]

This is what I got but it seems it's not working. When I test it, it just goes through and nothing gets returned. Is there something I'm missing? ...
4
votes
2answers
108 views

Iterative Tree Plot for the Sum of an Integer's Digits Squared

I am trying to make a graph that depicts integers<100 mapping to the sum of their digits squared. I can do this for one iteration, but I don't know how to do it for more than one, or until the new ...
26
votes
2answers
2k views

Trying to Visualize a Collatz - The Collatz conjecture

I happen to have this collatz collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0] So i want a visual 3D adjacency graph of my ...
0
votes
1answer
209 views

Prime number The Ulam spiral [closed]

I want a simple method of visualizing the prime numbers that reveals the apparent tendency of certain quadratic polynomials to generate unusually large numbers of primes. I was able to display the ...
5
votes
1answer
131 views

Find all “chains” in the poset of divisors

I want to input a set of divisors of an integer $n$ and return all subsets of these divisors ${d_1,d_2,...d_k=n}$ such that $d_1$ divides $d_2$, $d_2$ divides $d_3$, ... and $d_(k-1)$ divides $d_k$. I ...
3
votes
4answers
337 views

Permuted Prime Numbers

How can I produce all 3-digit and 4-digit prime numbers [100-9999] in which, all permutations of all digits produce again a prime number, such as 311, 131, 113, ...
9
votes
1answer
232 views

Possible improvements to this Syracuse (3x+1)/2 graph?

This algorithm produces the Syracuse disjoint tree graph without any duplicates. No need for Union, For, and ...
1
vote
3answers
163 views

List of prime powers

I have a list of not necessarily distinct prime powers. For example: {2,3,4,25,2,3}. I want to combine (multiply) the highest prime powers for each prime. In this case 25*3*4 = 300 since 25 is the ...