Questions on the number-theoretic functionality of Mathematica.

learn more… | top users | synonyms

1
vote
1answer
43 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
52 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.
0
votes
0answers
13 views

Show that 504 | (n^9 − n^3 ) for any integer n [migrated]

Not sure how to start this. I have equation of 504 is: 2 * 2 * 2 * 3 * 3 * 7, with $gcd(504)=7$
3
votes
1answer
49 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
0answers
14 views

Euler's criterion [migrated]

An integer $n$ is a square modulo $p$ if there exists another integer $ x$ such that n $≡$ $x^2$ (mod $p$). Theorem 1 (Euler’s Criterion). : $1$. If $n$ is a square modulo $p$ then $n^2$ $≡$ $1$ (mod ...
4
votes
2answers
61 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
79 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 ...
6
votes
2answers
857 views

Number of digits for factorial of 12345678987654321

A hard math problem 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 ...
6
votes
1answer
83 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
35 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
116 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
69 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: ...
3
votes
1answer
80 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
162 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
90 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
152 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
47 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 ...
2
votes
1answer
86 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
357 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. ...
1
vote
1answer
86 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
1answer
132 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
126 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
102 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
66 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
107 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
109 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
401 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
38 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
213 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
55 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
92 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 ...
0
votes
0answers
52 views

Dirichlet series expansion

Is there a way to get Dirichlet series expansions in Mathematica? For example, I would want DirichletSeries[Zeta[s], {s, 4}] to return ...
25
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
191 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
124 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
277 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
230 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
160 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 ...
4
votes
1answer
188 views

How to further accelerate arithmetic with Fermat Pseudoprime and Fibonacci number

I've been working on this all night, and I have made this go pretty fast, compared to my first iteration of the program, but now I'm out of ideas. I'm trying to write a program to test (by good ...
3
votes
2answers
218 views

Recursive Euclidean algorithm in Mathematica

Can anyone explain to me how do I use a recursion, if I don't know the limit? For example, I need the remainder $r$ of the Euclidean algorithm for $\gcd(a,b)$ which equals $0$. I figured out that the ...
2
votes
2answers
95 views

Need help with code for number theory problem

I'm completely new to Mathematica (used previously only for very simple cases). I need to write a quite complex function. The function must do the following: Input consists of two numbers: a and b. ...
2
votes
1answer
162 views

Using the Baby-Step Giant-Step algorithm

Here is a concept I am working through: As part of an attack on an El-Gamal cipher, solving the discrete logarithm problem $$10^x = 532107 \;\, {\rm mod} \;\, 1313839.$$ Using the ...
1
vote
1answer
132 views

Factoring large integers with the Pollard p-1 method

I am trying to use the Pollard $p-1$ method to find the factors of a large integer. Here is the problem: An RSA-type cipher is based on the integer $n = 140016480344628383$ and exponent ...
13
votes
3answers
717 views

Proving (or at least 'being told by Mathematica') that Sqrt[2] is irrational?

I realize that Mathematica is not specifically an automated theorem prover. However, this article: http://www.wolfram.com/products/mathematica/newin6/content/EquationalTheoremProving/ Suggests that ...
4
votes
5answers
321 views

On finding all the positive integral solutions of $x^2+y^2=z^2+1$

I am a new to Mathematica. My goal is to find many (if not all) positive integer solutions to the equation: $x^2+y^2=z^2+1$ using Mathematica. However the problem is that I can only find a ...
0
votes
1answer
83 views

solving quadratic and linear congruences with different modulus

We are able to solve the quadratic congruences $C^2 + Q^4 - 2\equiv mod 3072$ and $C - Q^2 - 2046\equiv mod 3072$ by entering ...
1
vote
3answers
131 views

Expressing a series formula

I want to generate a series of the following kind in Mathematica: $\quad \quad a(n+1) = a(n) + ({\rm prime}(n+1) - 1)/2 \quad \mbox{for odd primes},$ so that the resultant series is ...
0
votes
1answer
64 views

How to “de rationalize” a number? [closed]

How can 1/2 be represented as 0.5? Thanks!
2
votes
1answer
139 views

What are the terms of the sequence generated by Zeta(3s)/Zeta(s)?

The LiouvilleLambda function has Dirichlet generating function of Zeta[2s]/Zeta[s]. I am curious about an analogous function with Dirichlet generating function of Zeta[3s]/Zeta[s]. Can Mathematica ...