# Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

286 questions
Filter by
Sorted by
Tagged with
0answers
57 views

### Extending the Definition of GCD [closed]

Suppose we have $q \in \sqrt[b]{a}$ for $a,b\in\mathbb{N}$ and $$q=\prod_{\underset{p \le q, \ i\le|p|, \ k\in \mathbb{N}}{p\in\text{prime},\ j_i,i\in\mathbb{N}}} {p}^{({j_i}/{k})}$$ $|p|$ is the ...
1answer
33 views

### Prime factorization related functions: prime factor to its power and power of prime [duplicate]

FactorInteger can be used to perform prime factorization: FactorInteger[5^2 7^3 11^4] Results in: ...
1answer
41 views

1answer
868 views

### Why does Solve lock up when trying to solve the quadratic equation with large integers?

Why does Solve lock up when trying to solve the equation ...
0answers
64 views

1answer
70 views

### What is the best build-in function to pick or select given element in a huge list

im looking for a best and efficient function works like a search engine it takes for example m=5+6I ,then it goes searching in the list V={1,1+I,2+3I,...} until catch it . My Dr said to use "Select[]"...
2answers
314 views

### Efficient code for minimum integer with given number of factors

I'm seeking an efficient implementation of the number-theoretic function giving the smallest integer $n$ that has exactly $k$ factors (not necessarily prime): ...
2answers
149 views

### Finding $x$, the exponent of a $2^x$ when we need an specific output

Say we need a program Findx[n_Integer, m_Integer] where n is an integer from 1 to 9 and m is an integer from 1 to 1000. The output of the program is a number x, which is the exponent of 2 that ...
1answer
146 views

### Solving Diophantine equations 5 [closed]

Given a positive integers x,y,m would like to be able to find integer solutions z from Diophantine equation x^2-y^2 = m*z in Z. ---The proof,is divided in 4 sections---... x=2*k+1 ,y=2*h+1 with ...
0answers
61 views

### Problem in Counting the Number of Divisors with a Function [closed]

I want to create a function in mathematica which returns the number of divisors of a parameter x. So, I created the following function: d[x_] = Length[Divisors[x]]; And when I evaluate: d d ...
1answer
25 views

### Finding smallest domain within which variables can satisfy inequality

Given an arbitrary number of variables $\epsilon_i$ that can be picked from a domain $[0, W]$ and some inequality relation between all the variables $G(\epsilon_1, \epsilon_2, ...)$, is there some way ...
5answers
401 views

### Does Mathematica have a twin prime equivalent of PrimePi?

Well, it's all there in the title! I'd like to be able to plot the number of twin primes =<x. Is there an inbuilt function that can do this?
0answers
102 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 ...
1answer
40 views

### FunctionDomain in the Reals numbers [closed]

Why don't I obtain that $x$ belongs to the Reals? ...
2answers
87 views

### Simultaneous equation [closed]

How to solve Simultaneous equation in Mathematica: x^2 - (a^2 - 1)y^2 = 1 and y^2 - pz^2 = 1 where ...
1answer
88 views

### Number-theoretic function using Table

I'm trying to make a function to calculate the Log sum of primes over a limited range $1/2n$ to $n$ or Chebychev theta function over limited range $1/2n$ to $n$. This will be used only for even ...
4answers
312 views

### Find the order $m$ of a matrix ${\bf A}$ such that ${\bf A}^m= {\bf 1}$

I have a square matrix ${\bf A}$ defined over the field $\mathbb Z_2$ and I want to find its order such that ${\bf A}^m=1$. I tried using ...
1answer
49 views

### How to define a function the Dirichlet L-function $L(s,\overline{\chi(5,2)})$ in Mathematica?

In Mathematica: The Dirichlet L-function with character $\chi(5,2)$, $L(s,\chi(5,2))$, is expressed as DirichletL[5,2,s] Let $\overline{\chi(5,2)}$ be the complex ...
3answers
1k views

### François Viète's approximation to π

How do I program the approximation to π devised by François Viète, which is given by 2 * 2/Sqrt * 2/Sqrt[2 + Sqrt] * 2/Sqrt[2 + Sqrt[2 + Sqrt]] * ... ...
0answers
42 views

### Question about using ParallelMap to speed up computations [duplicate]

First; I define two functions: ...
2answers
100 views

### Code for finding $a$ and $b$ such that $a b = 1 \mod 4$ [closed]

I need to find $a$ and $b$ such that $a b = 1 \mod 4$? I do not know how to write the code. Could someone help me?
2answers
99 views

### Generating numbers palindromic in two number bases

The purpose of the code below is to generate numbers that are $2d+1$ digit palindromes in number base $b+1$, and are also palindromic in number base $b+3$, where: The ...
1answer
175 views

### Easy number theory problem

$p$ is an odd prime number，$S = \{x \mid 1 \leq x \leq 2p, x \in \mathbb{Z} \}$, $A$ is a subset of $S$, satisfying $\operatorname{card}(A) = p$ $\sum\limits_{x\in A} x \equiv 0 \pmod p$...
2answers
122 views

### Iterative calculation of a number-theoretical constant [closed]

Recently the decimal expansion of a number theoretic constant was searched for, which is the analog of the Landau-Ramanujan constant in a certain context. The constant starts 0.638909... It can be ...
1answer
98 views

### Finding minimum x such that Mod[3^x, m] == 1 for m not multiple of 3 [closed]

I would like to find smallest x value for each m value such that Mod[3^x, m] == 1, where m is not multiple of 3. Here is my ...
0answers
63 views

### Listing divisors of a number [closed]

I created a list with all divisors of 18000: list1 = Divisors I did an analysis to identify which of these numbers are divisible by $15$, but the result I ...
5answers
225 views

### Question about how to speed up Mathematica code

When looking at the Minimal Goldbach prime partition point {p,q} for each n; where n=10^i and i = 2,3,4,...,10; I notice that these points reside in an interval with center n/2 and radius 250: ...