Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

Filter by
Sorted by
Tagged with
0
votes
1answer
48 views

Non trivial zeros of Dirichlet L function

So I was wondering if I can find some of the non trivial zeros of the Dirichlet-L function using mathematica. What I found out was there is a code ZetaZero[] which ...
0
votes
0answers
96 views

How to implement statistics for the length of continued fractions of a result on MATHEMATICA

After successfully generating the reduced fraction of two coprime in interval (0,1] with the following; ...
4
votes
0answers
50 views

Residue for $L(s,\chi_1)$ not same in Mathematica as theoretical value

I want to find the residue of Dirichlet-L function, defined as $L(s,\chi)= \sum_{n=1}^\infty \frac{\chi(n)}{n^s}$ for $Re(s)>1$. We know that $Res_{s=1}L(s,\chi_1)=\frac{\phi(k)}{k}$, where $\chi$ ...
0
votes
0answers
24 views

Why does explicit Dirichlet Transform of Liouville Lambda not evaluate?

I have four expressions for the Dirichlet Transform of the Liouville-Lambda function, but one form does not evaluate, any ideas why and what could be done?
5
votes
2answers
121 views
3
votes
2answers
127 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
43 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
116 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
75 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 ...
0
votes
1answer
50 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 ...
9
votes
2answers
377 views

FactorInteger over UFDs

How can I factor 'integers' over other quadratic number fields (not just gaussian integers). For instance, how could I factor $7 = (3 + ω)(2 − ω)$ over Eisenstein integers ($ω = \frac{-1+ I \sqrt{3}}{...
-2
votes
1answer
33 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?
9
votes
1answer
341 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 - \cfrac{2^6}{...
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 ...
24
votes
8answers
4k views

Fastest square number test

What is the fastest possible square number test in Mathematica, both for machine size and big integers? I presume starting in version 8 the fastest will be a dedicated C LibraryLink function.
1
vote
2answers
104 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 ...
3
votes
0answers
116 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 ...
2
votes
2answers
318 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
123 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? <...
2
votes
1answer
106 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\...
3
votes
1answer
156 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 ...
1
vote
1answer
56 views

What is the mathematical operation corresponding to this definition of the Dirichlet Character group operation?

The Wolfram Language & System Documentation Center page for DirichletCharacter indicates Dirichlet characters modulo k form ...
5
votes
2answers
238 views

Is there an efficient way to calculate last digits of this sum?

Is there a more efficient way to find the last digits of the following sum for any $n$? $1 + n + n(n-1) + n(n-1)(n-2) + ... + \frac{n}{2!} + n!$ The method I currently use to find the last $d$ digits ...
0
votes
2answers
73 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: ...
11
votes
6answers
924 views

How can I plot a Farey diagram?

How can I plot the following diagram for a Farey series?
0
votes
0answers
45 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
37 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
59 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
99 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
116 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
107 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
107 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
4answers
386 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$$ ...
3
votes
2answers
87 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 ...
4
votes
2answers
155 views
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)^...
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 ...
1
vote
1answer
60 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 ...
5
votes
1answer
162 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
206 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
64 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 ...
7
votes
3answers
314 views

Calculating the integral points of an elliptic curve

I asked this question on Math stachexchange. The question I have is: Can I use Mathematica to find the (integral points on the following elliptic curve) or can I find when the number $\text{n}$ is a ...
0
votes
1answer
60 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] : ...

1
2 3 4 5
8