All Questions
Tagged with nt.number-theory algorithms
236 questions
1
vote
1
answer
178
views
+50
On a probabilistic integer factorization algorithm given bounds for one prime factor
We got a probabilistic integer factorization algorithm and experimental evidence with large
integers given bounds for one factor.
Let $D \ge 2$ be real number and let $p,q$ be primes and $N=pq$.
...
1
vote
0
answers
29
views
Factoring semiprimes via sum of two squares? [migrated]
The following thoughts came into my head after watching Grant Sanderson's JBPM award lecture here, in which he discusses the fact that we can quickly factor 3599 by noticing it can be written as (60-1)...
0
votes
0
answers
78
views
Factoring totient of a prime
Is it any easy to factor $p-1$ when $p$ is a prime compared to general factorization problem?
What about when $2p+1$ is also a prime?
1
vote
0
answers
57
views
Step back step forward algorithm for A108442
Let $a(n)$ be A108442. Here generating function is $\frac{1}{1-zA(z)}$ where
$$
A(z) = 1 + z(A(z))^2 + z(A(z))^3.
$$
Also
$$
a(n) = \sum\limits_{k=1}^{n}\frac{k}{2n-k}\sum\limits_{i=0}^{n-k} \binom{2n-...
2
votes
0
answers
182
views
Algorithm for $\frac{1}{1-x} = \sum\limits_{n=0}^{\infty}a(n)x^n\prod\limits_{k=1}^{n}\frac{1-kx}{1+kx}$
Let $a(n)$ be A208832. Here
$$
\frac{1}{1-x} = \sum\limits_{n=0}^{\infty}a(n)x^n\prod\limits_{k=1}^{n}\frac{1-kx}{1+kx}.
$$
Start with vector $\nu$ of fixed length $m$ with elements $\nu_i = 1$ (that ...
1
vote
0
answers
161
views
Efficient algorithm for A217061
Let $a(n)$ be A217061. Here
$$
a(n) = \sum\limits_{m=1}^{n}\frac{1}{(m-1)!}\sum\limits_{k=0}^{n-m}(n+k-1)!\sum\limits_{j=0}^{k}\frac{1}{(k-j)!}\sum\limits_{\ell=0}^{j}\frac{2^{\ell-j}(-1)^{\ell+j}s(n-...
0
votes
0
answers
65
views
Algorithm and equivalent recursion for A258173 (related to Dyck paths)
Let $a(n)$ be A258173 i.e. sum over all Dyck paths of semilength $n$ of products over all peaks $p$ of $y_p$, where $y_p$ is the $y$-coordinate of peak $p$.
A Dyck path of semilength $n$ is a $(x,y)$-...
0
votes
0
answers
60
views
Algorithm for $q$-Bell numbers
Let $T(n,k)$ be A126347 (i.e., triangle, read by rows, with row polynomials $B(n, q)$). Here
$$
B(n, q) = \sum\limits_{k=0}^{n-1}\binom{n-1}{k}B(k, q)q^k, \\
B(0, q) = 1.
$$
Start with vector $\nu$ of ...
3
votes
1
answer
435
views
What is the connection between these three methods of generating this sequence?
I was recently looking at this problem: “There are a number of balls in a jar, some of them red, some of them white. The odds of picking two at random and both balls being red is 1/2. How many of the ...
1
vote
1
answer
178
views
Algorithm for A127782
Let $a(n)$ be A127782 (i.e., an integer sequence with generating function $A(x)$ such that $A(x)=1+xA(x+x^2)$). Here
$$
a(n) = \sum\limits_{k=0}^{\left\lfloor\frac{n-1}{2}\right\rfloor} \binom{n-k-1}{...
2
votes
0
answers
61
views
Algorithm for main diagonal of integer coefficients associated with Schroeder numbers
Let $T_q(n, k)$ be an integer table such that
$$T_q(n, k) = \begin{cases}
1 & \textrm{if } n = 0 \vee k = 0 \\
qT_q(n-1, n-1) + T_q(n, n-1) & \textrm{if } n = k > 0 \\
T_q(n, k-1) + T_q(n-1,...
3
votes
1
answer
178
views
Algorithm for the sum with binomial coefficients and Bell numbers
Let $a(n)$ be A000110 (i.e., Bell or exponential numbers: number of ways to partition a set of $n$ labeled elements).
Let $b(n)$ be A355247 (i.e., expansion of exponential generating function $\exp(2(\...
5
votes
1
answer
303
views
Efficiently computing $\prod_{i=1}^{n} A_i$
Let $k$ be a nonnegative integer, how to compute $\prod\limits_{i=1}^{n} A_i$ quickly and accurately, where $$A_i=\begin{bmatrix}
0 & 1\\
i^k & 1
\end{bmatrix}?$$
I know if $k=0$, we can use ...
4
votes
1
answer
112
views
On a number of compositions of $n$ into positive triangular numbers
Let $a(n)$ be A023361 (i.e., number of compositions of $n$ into positive triangular numbers). Here
$$
a(n) = \sum\limits_{i \geqslant 1, \frac{i(i+1)}{2}\leqslant n} a(n-\frac{i(i+1)}{2}), \\
a(0) = 1....
1
vote
0
answers
121
views
Simple algorithm for A107670
Let $T(n, k)$ be A107670 (i.e., matrix square of triangle A107667). Here we define the triangular matrix $P$ by $P(n, k) = \frac{(n+1)^{2(n-k)}}{(n-k)!}$ for $0 \leqslant k \leqslant n$ and the ...
4
votes
1
answer
130
views
Intersecting algorithm for A065601
Let $a(n)$ be A065601 (i.e., number of Dyck paths of length $2n$ with exactly $1$ hill). Here
$$
a(n) = \frac{1}{2(n+1)}((3n-2)a(n-1) + 2(9n-19)a(n-2) + 4(2n-3)a(n-3)), \\
a(0) = a(2) = 0, a(1) = 1.
$$...
3
votes
0
answers
165
views
Elegant algorithm for A140717
Let $T(n, k)$ be A140717 (i.e., triangle read by rows: $T(n,k)$ is the number of Dyck paths $d$ of semilength $n$ such that sum of peakheights of $d$ - number of peaks of $d$ equals $k$ ($n \geqslant ...
2
votes
0
answers
64
views
On a $\sum\limits_{n=0}^{\infty}c_n x^n=\sum\limits_{n=0}^{\infty}a(n)x^n\prod\limits_{k=1}^{n+1}(1-f(k)x^k)$ (slightly different question)
Please note that this question differs from one of the previous questions of mine.
Let $f(n)$ be an arbitrary function with integer values.
Let $c_n$ be an arbitrary integer sequence.
Let $a(n)$ be ...
9
votes
0
answers
258
views
On a continued fraction and vector $\nu$ of length $n$
Please note that this question has been completely reworked in order not to overload it with unnecessary and useless information.
Let $f(n)$ be an arbitrary function with integer values.
Let $a(n)$ ...
2
votes
1
answer
132
views
On an integer factoring algorithm based on smooth class number of quadratic fields
We got an algorithm and toy implementation of integer factoring algorithm
based on smooth class number of quadratic fields.
It is close to the elliptic curve factorization method (ECM) and
succeeds if ...
2
votes
1
answer
108
views
On square root modulo $2^t-1$
Is there a way to compute an $x$ satisfying $$x^2\equiv a\bmod(2^t-1)$$ where $a,t$ are integers given to us and factorization of $2^t-1$ is not given to us?
12
votes
3
answers
715
views
When does $2$ arise when using the Euclidean algorithm to compute greatest common divisors?
When using the standard Euclidean algorithm to compute the greatest common divisor of a pair of relatively prime positive integers, the integer $2$ sometimes arises and sometimes does not. For example,...
2
votes
0
answers
100
views
Another (unique) algorithm for the A329369
Let $a(n)$ be A329369 (i.e, number of permutations of ${1,2,...,m}$ with excedance set constructed by taking $m-i$ ($0 < i < m$) if $b(i-1) = 1$ where $b(k)b(k-1)\cdots b(1)b(0)$ ($0 \leqslant k ...
1
vote
0
answers
83
views
Non-vanishing of product of zero divisors in quotients modulo $n$
This might be of practical importance and even partial answer will help.
Let $n$ be odd squarefree integer with known factorization $n=\prod p_i$
with $N$ prime factors.
Later we are not asking about ...
0
votes
0
answers
197
views
On the integer solutions of the equation $y^2 = x^3 + n$
Let $n$ be a nonzero integer. I am interested in the integer solutions $(x, y)$ to the equation $y^2 = x^3 + n$.
Let $S$ be the set of all integer solutions $(x, y)$ to this equation.
I am wondering ...
3
votes
0
answers
128
views
Fast and simple algorithm for the A329369
Let $a(n)$ be A329369 (i.e., number of permutations of $\{1,2,\cdots,m\}$ with excedance set constructed by taking $m-i$ ($0 < i < m$) if $b(i-1) = 1$ where $b(k)b(k-1)\cdots b(1)b(0)$ ($0 \...
2
votes
1
answer
134
views
On a efficient algorithm for factoring bivariate polynomials modulo composite modulus assuming the solution is unique
We found and implemented in sage efficient algorithm for factoring
bivariate polynomials modulo composite modulus assuming the solution is unique up to a constant factor.
More formally let $K=\mathbb{...
1
vote
1
answer
217
views
Correctness of the algorithm for the A329369, A347205 and related sequences
Let $a(n)$ be A347205. It is enough for us to know that
$$
a(2^m(2k+1)) = \sum\limits_{j=0}^{m}a(2^jk), \\
a(0) = 1
$$
Let $b(n)$ be A329369. It is enough for us to know that
$$
b(2^m(2k+1)) = \sum\...
4
votes
1
answer
279
views
Fibonacci and matrix modular exponentiation
I'm interested in a few problems that are related enough that I decided to put them all in one question.
What are the fastest known algorithms for finding large Fibonacci numbers modulo $p^k$, and ...
42
votes
4
answers
4k
views
Are these fast convergent series for $\log(2)$, $\log(3)$ and $\log(5)$ already known and proven?
Now that some of the previously MSE formulae that I left here have been applied Dec.2023 to compute high precision record values ($10^{12}$ decimal digits) of trascendental constants $\Gamma(1/3)$ (Eq....
2
votes
0
answers
489
views
Are these finite semirings known?
I am trying to prove the properties below, and by doing this, I hope to find a way to speed up the computation of the below defined addition and multiplication. I am also interested if these finite ...
4
votes
2
answers
320
views
Approximating a fraction with a given denominator
Let $M$, $N$ be large natural numbers (say ~200 bits). Let $L$ be a smaller number, (say ~100 bits).
I want to approximate the fraction:
$$\frac{M}{N} \sim \frac{k}{L+r}$$
where $r$ is at most $L$. In ...
7
votes
1
answer
268
views
Efficiently computing $\sum_k x^{k^2}$ modulo $p$
Let $p$ be prime. There is a whole host of "large" degree polynomials that can be computed efficiently modulo $p$. I was wondering if:
$$q(x) = \sum_{k=0}^{p-1} x^{k^2}$$
is a polynomial ...
4
votes
0
answers
128
views
Looking for a generalization of fast Fourier transform form for Gauss sums
I want to compute quickly compute a sum of the form
$$\sum_{k=0}^{N}\sum_{l=0}^{M} e(g^{a^k*b^l})$$
Assume $a^N = b^M = 1$ modulo $q-1$.
Where $e(x) = e^{2\pi ix /q}$. This is very similar to the ...
13
votes
1
answer
1k
views
Apéry's constant $\zeta(3)$ fastest convergent series
UPDATE Feb.02.2024
The series below, Eq.(3) for computing and Eq.(2) for verifying, were applied by Andrew Sun on Dec.22.2023 to get over $2\cdot10^{12}$ decimal digits and break the number of ...
1
vote
0
answers
285
views
Can we avoid all algebraic numbers?
We say a polynomial $p$ in $n$ variables degree at most four, and coefficients $-1,0,1$ is $n$-plain.
We say $x$ is an $n$-plain algebraic number if there exists an $n$-plain polynomial $p$ such that
$...
1
vote
0
answers
136
views
Quadratic equations over Gaussian integers
Given an equation $x^2\equiv(a+ib)\bmod(c+id)$ where $a,b,c,d\in\mathbb Z$ holds, how to test if the equation has solutions and how to find the solutions in polynomial in $\log(|abcd|)$ time if $c+id$ ...
2
votes
2
answers
1k
views
Using Kolmogorov complexity to measure difficulty of problems?
We call the natural number $n$ a partition number $\iff$
$$
\exists d | n: \gcd\left(d,\frac{n}{d}\right)=1 \text{ and } \Omega(d) = \Omega\left(\frac{n}{d}\right)\;,
$$
where $\Omega$ counts the ...
1
vote
1
answer
167
views
Algorithm for finding integers in a range with multiples in a short interval
Is there a quick way to determine which integers $D < d\leqslant 2D$ are such that $d$ has a multiple in $[X, X + H]$? Here, $H$ should be thought of as much smaller than $D$, and $X$ larger than $...
7
votes
1
answer
722
views
Alternate algorithms for Chinese remainder theorem
I was teaching Discrete this semester and set the students loose on a system of linear congruences. One of them came up with this solution. Say $$ x \equiv 1 \textrm{ mod } 3 $$ $$ x \equiv 3 \textrm{ ...
2
votes
0
answers
201
views
On GCD and lattice reduction
$LLL$ algorithm is vectorized version of Euclidean algorithm for $GCD$.
Even the $m=2$ case known to Lagrange and Gauss does not have an $NC$ algorithm for shortest vector.
If $GCD$ is in $NC$ and in ...
4
votes
0
answers
104
views
Questions in number theory related to $NC$ and $P$-completeness
Given $a,b\in\mathbb N$ find $\operatorname{GCD}(a,b)$.
Given $a,b,c\in\mathbb N$ find $x,y\in\mathbb Z$ such that $ax+by=c$.
Euclidean algorithm solves both.
My question is if either 1 or 2 is in ...
0
votes
0
answers
462
views
Relation between sieve wheel and Sundaram sieve
I made this sieve for prime numbers, which I briefly describe:
We consider $\quad p=r+modulus \cdot k \quad$ with $\quad modulus=p_1*p_2* \cdots *p_m$
and then we choose an appropriate reduced ...
3
votes
0
answers
135
views
Recover cyclotomic integer with bounded coefficients from its known associate
Recall that two cyclotomic integers are called associated if their ratio is a unit in the corresponding ring of cyclotomic integers.
We will view cyclotomic integers as polynomials (of degree $<\...
9
votes
1
answer
737
views
Square root in number field
I'm trying implement an algorithm that, for an element $b$ of a number field $\mathbb{Q}(\alpha)$, if it is a square in $\mathbb{Q}(\alpha)$ (i.e., $\exists x\in\mathbb{Q}(\alpha):x^2=b$), computes ...
3
votes
1
answer
194
views
Checking presence of a specific term in product polynomial
I have a multivariate polynomial $P$ which is a product of $M$ low degree polynomials $p_i$
$$P(x_1, x_2, \dotsc, x_n) = \prod_{i=1}^M p_i(x_1, x_2, \dotsc, x_n)$$
where the maximum degree of each $...
17
votes
1
answer
1k
views
Catalan's constant fast convergent series
NOTE. UPDATE 2 introduces proven series for Catalan's constant that is possibly the fastest currently known.
Working with some conjectured continued fractions that were published here, I have found ...
12
votes
1
answer
392
views
Euclid's algorithm as a combinatorial game
Consider the following two player game based on the Euclidean algorithm: Positions are given by $(a,b)$ in $\mathbb N^2\setminus\{(0,0)\}$ (where $\mathbb N=\{0,1,2,\ldots\}$) defining a greatest ...
1
vote
0
answers
72
views
Forming rational numbers using unique Egyptian fractions
Question: For a given rational number $r\in (0,1)$, does there exists a finite, ordered set $S\subset \mathbb{N}$ such that the product of the first $k$ elements of $S$ do not divide the $k+1$th ...
3
votes
2
answers
900
views
Efficiently finding the largest divisor of N less than sqrt(N)
Suppose you have a number
$$
N = p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}
$$
and are looking for the largest divisor $d|N$ such that $d^2<N$ (that is, A060775$(N)$.) How can I efficiently find this $d$?
...