# Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

370 questions
Filter by
Sorted by
Tagged with
2answers
113 views

...
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}$. ...
1answer
29 views

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\}$$
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 ...
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[] ...
2answers
84 views

### using DeleteCases with CoprimeQ

first let me show what I have working correctly f = Permutations[Range, {3}] Riffle[f, Apply[CoprimeQ, f, {1}]] now I would like to automate the deletion of a ...
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$$ ...
2answers
154 views

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

I have the following code: ...
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 ...
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 ...
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 ...
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 ...
1answer
114 views

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 ...
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 ...
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 ...
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 ...
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 ...