# Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

421 questions
Filter by
Sorted by
Tagged with
140 views

### System of equations

I am trying to find ALL or a list of possible values for x satisfying: x MOD 9 ==2 AND (x+631) MOD 9 = 3 Using Mathematica. can anyone help? 2 is not the only answer 497 is another one since 497 mod ...
105 views

1 vote
47 views

### Check certain expression using a while loop to run through all posibilities in a range

Well, I have written the following code (using the fast square root test found in this answer): ...
256 views

### Longest arrangement of n-digit square numbers s.t. last digit equals first digit of next

I have this problem: consider all the square numbers with exactly n digits, I want to arrange them such that the last digit of a square is equal to first digit of the next square and find the longest ...
1k views

### The integer ababab (a,b>0) is always divisible by 7, without remainder

The integer $ababab$ $(a>0,b>0)$ is always divisible by $7$, without rest. I tried to prove this by: ...
185 views

### How do I maximize the following?

I want to maximize $${T(\epsilon)=\max\left\{\log_{(1/y)}\left(|\sqrt{2}-x/y|\right):x,y\in\mathbb{N}, |\sqrt{2}-x/y|<\epsilon\right\}}$$ Edit: I changed the inequality, it was supposed to be ...
94 views

### Divisibility problem! I cannot find a proof. Help would be appreciated! [closed]

It appears that IntegerQ[(2 k - 2^k)/(2 k + 1)] and IntegerQ[(2^k + 1)/(2 k + 1)] have the same k values. Proof?
1 vote
92 views

### Faster PowersRepresentation using IntegerPartitions

Earlier I posted a question about taking fast integer square roots of known integer perfect squares. The reason this came up is I was trying to find a faster way of mimicking the PowersRepresentations[...
87 views

### Mathematica code for q-Stirling numbers

In the paper [A new $q$-Analog of Stirling Numbers],(https://hal.archives-ouvertes.fr/hal-01372920/document)[PDF] J. Cigler defined $q$-Stirling numbers of the second kind as the following: He ...
56 views

### Check if a fraction leads to an integer, choose $r$ and run trough $0\le a\le n$ and go to $r+1$

Well, I am trying to do the following: I have two functions $y(r,a)$ and $z(r,a)$ and I want to check of the division of both those functions leads to an integer. In order to do that I want to choose ...
109 views

### Finding IntegerPartitions with no zero and no duplicates

Well, I am trying to execute the following code: ...
47 views

### Alternative for PowerRepresentations[n, x, 1]

I am looking for numbers $n$ that can be written as the sum of other numbers. So: PowersRepresentations[n, x, 1]. But is there a faster way of finding these numbers?...
44 views

### Fourier expansion of Dedekind eta function with rational arguments

I want to be able to compute the Fourier series expansion in q=Exp[2πiz] for DedekindEta[(az+b)/(cz+d)] with integer a,b,c,d, but not requiring ad-bc=1. Just replacing z in terms of q and doing ...
313 views

### Checking if a number is right sorted

I have a number $n$ such that the digits of $n$ are strictly increasing to the left except for the first digit. So for example when $n=51369$ fits the bill because: $$1<3<6<9\tag1$$ Is there ...
151 views

### Calculate the Leyland number index of a given Leyland (x,y) pair

A Leyland number L(x,y) is x^y + y^x where x>=y>1. OEIS A076980 prepends L(2,1) as its first term. The first ten Leyland number (x,y) pairs ordered by magnitude are (2,1), (2,2), (3,2), (4,2), (...
334 views

### Sum a number's digits until only one digit remain

I want to iteratively calculate the sum of a number's digits, until the result contains only one digit. For example, when $n=67946$ we get: $$6+7+9+4+6=32\space\to\space3+2=5\tag1$$ So, when $n=67946$ ...
97 views

168 views

289 views

### Largest k such that p^k divides n

(Here all variables are integer.) Is there a built-in function f[n,p] such that f[n,p] = largest k such that p^k divides n For ...
149 views

### define edge set of a graph

I want to define a graph in Mathematica which its vertex set is cartesian product of two sets. I define the vertex set by Tuple[] but two vertices are adjacent if and only if the intersection of the ...
77 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 ...
99 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; ...
### 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$ ...