Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

Filter by
Sorted by
Tagged with
5
votes
2answers
113 views

Counting zeros of list from Twin Primes calculation

...
3
votes
2answers
117 views

How to FInd the sum of odd divisor of a number in Mathematica?

So I want to find the sum of odd divisors of a number raised to some power. $i.e.$ I want to find $\sum_{n=1}^\infty\sigma'_{-2k-1}(n)$ where $\sigma'_{-2k-1}(n) = \sum_{d|n, \text{d odd}} d^{-2k-1}$. ...
0
votes
1answer
29 views

Find a solution to a congruence within a specified range

My problem is to find all the integer solutions of the following conguence: $$P=0\ \text{mod}\ 4$$ where $$p=q^2∗r^2∗y^4∗z^2∗(2∗w^4+2∗r^2∗w^4∗y^4∗z^2+r^2∗w^8∗y^4∗z^2+2) + q^2+ 2∗r^6∗w^4∗y^m∗z^6∗(w+w^2+...
1
vote
1answer
34 views

Recursive Dirichlet convolutions and sum errors

I only have an informal knowledge of mathematical at best, learned entirely from modifying premade programs, and reading the documentation of functions, so I apologize if my question should be obvious ...
0
votes
1answer
38 views

Numerical value of Derivative of Dirichlet L function at some particular points [closed]

I want to find the numerical value for the derivative of Dirichlet L function to compare with an another formula. However I am not able to obtain any numerical values. I tried to use ...
2
votes
1answer
106 views

Comparing the plots of two functions in number theory

Definition. For $x>1$, let $$R(x):=\sum_{n\ge1}\frac{\mu(n)}{n}\,\operatorname{li}(x^{1/n})$$ denote the Riemann prime counting function. If you are not familiar with the mathematical expressions ...
0
votes
1answer
114 views

Factorizing large numbers [closed]

I am trying to factorize large prime numbers with the code bellow. The code works properly for values like 1927 and 69527 (results), but gives no result for larger values like 655051. The code goes as ...
1
vote
2answers
73 views

How can I test if the sum of two divisors of a number add up to a perfect square? [closed]

Let's say I have a number $n$ and I want to find the divisors of $n$, I can do that using Divisors[n]. That will generate a list ...
11
votes
8answers
1k views

Transform a number to a factorial

I came across the need to transform a number into a factorial n, with positive integer n. I have searched in the MMA information but I can't find anything like that. I imagine an input, which verifies ...
-2
votes
1answer
32 views

Find a number from the remainders modulo two integers [closed]

If the remainder of the division of $n$ by 7 equals 5, what is the remainder of the division of $2n$ by 7?
0
votes
1answer
49 views

Random composite integer n with 200 digits and Miller-Rabin witnesses [closed]

I wanna take a random composite integer n with 200 digits and check how many, out of 100 random integers, that are Miller-Rabin witnesses for compositeness of the integer n. The first thing I need to ...
2
votes
1answer
59 views

Strange results from FrobeniusSolve

As part of pruning for my code searching for optimal addition chains I want to try and find some fast ways to discover that certain numbers are not representable in the Frobenius coin problem. An ...
3
votes
0answers
115 views

Does anyone have a Mathematica implementation of the standard $\arg\zeta(s)$ function required to evaluate $S(T)$?

This question is related to my question Is there an elegant exact formula for the zeta zero counting function? on Math StackExchange. Question: Does anyone have a Mathematica implementation of the ...
1
vote
2answers
103 views

Whats the Mathematica command for the skew harmonic number?

What's the Mathematica code for the skew harmonic number: $$\overline{H}_n=\sum_{k=1}^n \frac{(-1)^{k-1}}{k}.$$ Wolfram expresses this number as $$\ln(2)-(-1)^n \text{LerchPhi}(-1,1,n+1).$$ I am ...
2
votes
2answers
317 views

How to ask Mathematica to solve a simple modular equation

What's the most straightforward way to ask Mathematica to find all solutions of an equation like $$3x + 2y + 4z = 0 \pmod {11}$$ (for instance), where either $x$, $y$, $z$ can be considered to be ...
3
votes
1answer
151 views

Solving calculation puzzle [closed]

I recently got asked how to achieve a result of 100 only using the numbers {1,7,7,7,7} (the number 1 can be used only once and ...
1
vote
2answers
120 views

Plotting Riemann Prime Counting

I want to program the formula in this page. Didn't take me long to get to my code below. But 1) it only plots the prime counting function and 2) evaluation takes incredibly long. How can I fix it? <...
0
votes
2answers
70 views

Combining lists of a factors with multiplicity

I want to combine factorizations of integers (in the form output by FactorInteger, that is a list of factors with multiplicities) into the factorization of the ...
3
votes
1answer
176 views

Using dynamic programming to compute an integer sequence

Let a[n] = n + 1 - a[EulerPhi[n]], n integer > 0. I have Python code that generates the sequence using dynamic programming. How can I achieve the same thing elegantly/idiomatically in Mathematica? ...
0
votes
0answers
46 views

Finding if a number is perfect square [duplicate]

I used the following code to found if a specific number is a perfect square: ...
0
votes
0answers
44 views

Do these solutions actually amount to a solution over the Reals and not over the Complexes as Mathematica says?

The following program outputs approximations to ZetaZero[1] and ZetaZero[-1]: ...
1
vote
1answer
36 views

Manipulate giving errors when I plot the product of a step function and a continuous function

Riemann's prime counting function J (link) takes half-values at every jump-discontinuity. So, I define it thus: ...
2
votes
1answer
58 views

Find values of n for which expression is integer

I have an expression for which I want ot find values of n that will make it an integer. Here is the expression: (n^(3/2) - n)^(1/3) or n^(1/2) - n^(1/3) I want to ...
2
votes
2answers
98 views

Solving a diophantine equation in 'large' values

Let's first discuss what I am trying to solve: I want to solve the diophantine equation stated below for relatively 'large' values of $r$. $$\frac{a(a + 3)(a(r - 9) + (7 - r))}{12}=\frac{b (3 + b (-5 +...
3
votes
1answer
115 views

How to ask Mathematica to range all the natural numbers $1<n<500$ which are not multiples of 5? [closed]

How can I ask Mathematica to range all the natural numbers $1<n<500$ which are not multiples of 5? I mean I need to get $$\{1,2,3,4,6,7,8,9,11,12,13,14,16,...,499\}$$
2
votes
3answers
106 views

What is the probability of the digit $k$ in the number $x^n$

Well, the title of the question says it all: how to write a code that finds the probability of the digit $k$ in the number $x^n$? For example, when $x=2$, $n=100$, and $k=7$ we are trying to find how ...
1
vote
5answers
104 views

How to find the 2 smallest integers that is divisible by 40131 and 41405 [closed]

I'm trying to find the two smallest integers that is divisible by 40131 and 41405, i.e 40131|a, 41405|a, 40131|b and 41405|b. There is a hint within the question that says you can use FactorInteger[] ...
3
votes
2answers
84 views

using DeleteCases with CoprimeQ

first let me show what I have working correctly f = Permutations[Range[5], {3}] Riffle[f, Apply[CoprimeQ, f, {1}]] now I would like to automate the deletion of a ...
3
votes
4answers
383 views

Solving an equation in natural numbers

I am trying to solve the following equation in the Natural Numbers, with the condition $a\ge1$, $b\ge1$, and $r\ge3$: $$\frac{a(a + 3)(a(r - 5) + (12 - r))}{9}=\frac{b (9 + b (-14 + r) - r)}{3}\tag1$$ ...
4
votes
2answers
154 views

Finding the number of even numbers in Pascal's triangle (code gives memory error)

I have the following code: ...
2
votes
1answer
82 views

How to write this simple task of unimodular prime search in mathematica?

For testing a particular algorithm I found mathematica is the best way as it has all the tools I need. I am stuck in a number theory part and since I am not an expert in mathematica I do not know how ...
5
votes
1answer
157 views

RSA encryption/decryption with signed message

I was going through a book with some tasks that you can work with mathematica on, and I found this particular task interesting: Proffesor Alice has sent an assignment to Bob, one of her students. To ...
3
votes
2answers
202 views

Exact division and geometric sequences

I imagine this problem has a name that I don't know; it's probably some sort of exact division problem. Here goes: imagine you have to divide 4 cookies among 11 people. Divide the cookies equally ...
1
vote
0answers
61 views

FactorInteger snippet works, but use of Sow/Reap/Print is clunky

This is a code review or de-clunking request. If it doesn't belong here, I'll withdraw it. The below toy works and produces the proper output, that is, for numbers to be factored that can be expressed ...
0
votes
1answer
114 views

Writing a program that finds for what $(x,y)$ a function gives a perfect square number

The overal question I am trying to answer is: For what $(x,y)$, which are positive integers, is the following number a perfect square number? $$9 \left(x^3 (y-2)^2+3 x^2 (y-2)-2 x (y-45) (y-2)+7 (y-1)^...
1
vote
1answer
59 views

A modular version of LinearRecurrence?

I'm playing around with implementing the Lucas probable prime test (mainly so I can understand it better), and would love a version of the LinearRecurrence function that used addition modulo n (with n ...
0
votes
1answer
59 views

How to get smooth numbers efficiently by using dependent iterators in Table

I have the following code for getting smooth numbers up to Prime[4] : ...
2
votes
0answers
61 views

How do we add up length of sub-intervals whose start-points belong to fractions with an even or odd denominator less than $n$?

Suppose we divide $[0,1]$ into sub-intervals whose start-points contains fractions in $[0,1]$ with a denominators less than integer $n$. Then suppose we add the lengths of sub-intervals whose start-...
2
votes
1answer
94 views

Least common multiple and greatest common divisor problem.What instruction to use?

Here we have an equation in two variables that involves the greatest common divisor and the least common multiple, I can't think of what else to use. $$Reduce[(LCM[x, y])^2 + (GCD[x, y])^ 2 == 900]$$ $...
2
votes
2answers
60 views

Creating a Table with varying depth and interdependent limits

As an example I want to find all Integers up to a given limit which only have certain prime factors. I can do it efficiently for the case of 2, 3, and 5 by ...
4
votes
0answers
109 views

Prime factorization over the Eisenstein integers $\mathbb{Z}[\zeta]$

I am trying to write a function f[a_,b_] which takes in two integers $a,b$ and returns the unique factorization of $a+be^{2\pi i/3}$ into the primes belonging to $\...
0
votes
0answers
58 views

Analytic continuation of the prime zeta function

I want to plot the real part of the prime zeta function over the imaginary axis. This should be doable since the prime zeta function has an analytic continuation up to the imaginary axis. However, ...
1
vote
0answers
31 views

Generating a list of the degree-$n$ Kronecker polynomials

A Kronecker polynomial is a polynomial such that Its coefficients are integers, Its roots are on the unit circle or $0$, Its leading coefficient is $1$. From here, there are finitely many Kronecker ...
1
vote
2answers
56 views

Filtering solutions in PowerRepresentations

I have the following code: PowersRepresentations[10400, 7, 2] This produces Length[PowersRepresentations[10400, 7, 2]]=433789 ...
2
votes
1answer
104 views

Riemann Prime Counting Function correction/pairing terms by Mathematica

Riemann Prime Counting Function: $$f(x)=\operatorname{li}(x)-\sum_\rho\operatorname{li}(x^\rho)-\ln 2+\int_x^\infty \frac{\mathrm dt}{t(t^2-1)\ln t}$$ The second correction/paring terms: $$\sum_\rho\...
1
vote
0answers
62 views

Is there some programs about the fast inverse descrete time Fourier transform

At first, I give the definition of the inverse discrete-time Fourier transform $$\phi(s)=\frac{1}{2\pi}\int_{-\pi}^{\pi}\exp(iks)f(k)dk$$ Here what I use is ...
1
vote
0answers
19 views

Question about AsymptoticEqual[nChebyshevPsi[x], x, x -> Infinity]

Given the partial sum function nChebyshevPsi[x_] := Sum[MangoldtLambda[y], {y, x}] I would like a True response from ...
5
votes
2answers
138 views

How does `DirichletConvolve` relate to Dirichlet convolution?

Mathematica's Help documentation on DirichletConvolve is economical, to say the least. It claims the function "gives the Dirichlet convolution of the ...
5
votes
3answers
357 views

Writing a program that divide numbers until I hit a one digit number

Well, I have the following question: How can I write a program such that an input number $n$ is divided by the number $k$ as long as the resulting number does not have one digit, if the resulting ...
3
votes
1answer
66 views

About a problem with FromDigits

I have tried FromDigits[{{1, 2, 3, 4},{2,3, 4, 1}, {3, 4, 1, 2}, {4, 1, 2, 3}}] and the result is as expected {1234,2341,3412,4123}. However for ...

1
2 3 4 5
8