Questions tagged [algorithms]
Informally, an algorithm is a set of explicit instructions used to solve a problem (e.g. Euclid's algorithm for computing the greatest common divisor of two integers). For more specific questions on algorithms, this tag may be used in conjunction with the approximation-algorithms, algorithmic-randomness and algorithmic-topology tags.
1,677 questions
16
votes
5
answers
1k
views
Algorithm for selecting a fixed-point free permutation $\varphi:\{1,\ldots,n\}\to\{1,\ldots,n\}$
Motivation. In my younger son's class, everyone has to give a (small) Christmas present to one other student. Let $n\in\mathbb{N}$ be the number of students in the class. If you pick a permutation $\...
2
votes
0
answers
29
views
Fast calculation of the circum hyperspheres of n-simplices
first the trivial facts:
Non-degenerate n-dimensional simplices have $n+1$ corners and $\frac{(n+1)n}{2}$ edges.
The center of the circum-hypersphere from which all $n+1$ corners are equidistant can ...
0
votes
0
answers
37
views
$O(1)$ algorithm for factoring integers of the form $n=X (X^D+O(X^{D-1}))$
Factorization of integers of special forms are of both theoretical
interest and cryptographic implications.
Experimentally we found a seemingly "large" set of integers for which a divisor ...
3
votes
1
answer
315
views
Is there an algorithm which, given integer $k \ge 2 $, find all abc-tuple with $\mathrm{rad}(abc)=k$?
According to this lecture on abc
https://www.youtube.com/watch?v=zk4U5P61LbM&t=1960s around 18:00
there is a "subtle theorem" that for fixed $k \ge 2$, there are only finitely many ...
0
votes
1
answer
119
views
Closed form solutions of $x^D+y^D=n$ and $y^D-x^D=n$ assuming $y>x^{D/(D-1)}$
Let $x,y,X,Y,D>1$ be positive integers.
Let $X^D+Y^D=n$ and assume $Y>X^{D/(D-1)}$.
Conjecture 1 $Y=\lfloor n^{1/D}\rfloor$ and $X=(n-Y^D)^{1/D}$
Let $Y^D-X^D=n$ and assume $Y>X^{D/(D-1)}$.
...
0
votes
0
answers
20
views
Sufficient condition for shortest path expansion by Minimum Mean Cost Cycle
Let $G=(V,A)$ be a directed graph, such that for any two vertices $v,w$, there exists a vertex $u$ such that $(v,u),(u,w)\in A$. Let $s,t\in V$, and let $c:A\rightarrow \mathbb{N}_{\geq 1}$ be arc ...
0
votes
0
answers
154
views
$O(1)$ algorithm for factoring integers of the form $p(p+O(\sqrt{p}))$?
Let $p,C$ be positive integers and assume $0 < C< \sqrt{p}$
Let $n=p (p+C) $ and assume $n$ is odd.
Conjecture 1 Given $n$ we can find $p,p+C$ with complexity computing two integer square roots ...
0
votes
0
answers
158
views
On factoring integers of the form $n=(x^D+1)(y^D+1)$ and $n=(x^D+a_{D-2}x^{D-2}+\cdots+ a_0) (y^D+b_{D-2}y^{D-2}+... b_0)$ with $x,y$ of the same size
From our preprint On factoring integers of the form $n=(x^D+1)(y^D+1)$ and $n=(x^D+a_{D-2}x^{D-2}+\cdots+ a_0) (y^D+b_{D-2}y^{D-2}+ \cdots+b_0)$ with $x,y$ of the same size.
We got plausible ...
11
votes
1
answer
464
views
Is there any algorithm which can find a common divisor of two polynomials modulo $p^k$?
Let us consider two monic polynomials $f(X), g(X) \in \dfrac{\mathbb{Z}}{p^k\mathbb{Z}}[X]$. Now, we call $h(X)$ is a divisor of $f(X)$, if there exists a $l(X) \in \dfrac{\mathbb{Z}}{p^k\mathbb{Z}}[X]...
7
votes
0
answers
147
views
the complexity of transfinite comparison sorting
The story of finitary deterministic comparison sorting is well-known: we have the naive $O(n^2)$-time algorithms like selection and insertion sorts; once we try divide-and-conquer recursion we ...
0
votes
1
answer
117
views
Optimal probing problem
We are provided with a set of $n$ targets.
Each target is characterized by a utility value.
We know the distribution of the utility value for each target, but do not know its current value.
Therefore, ...
2
votes
0
answers
142
views
Rewriting a quaternary cubic as sums of $5$ cubes of linear forms
This question was first asked here but got no answer.
This paper by R. Garver talks about removing 4 terms from the 9th degree equation. Although everything is easy to understand, there was an ...
1
vote
2
answers
319
views
Algorithms to count restricted injections
Let the following data be given.
Two positive integers $m$ and $n$.
A family of sets $B_a \subseteq \{1, \dots, n\}$ (for $a \in \{1, \dots, m\}$).
The task is to count the number $N$ of injective ...
1
vote
0
answers
83
views
Similar algorithms for exponential transforms of some exponential generating functions
Let
$a_1(n)$ be A003713, i.e., an integer sequence whose exponential generating function $A_1(x)$ satisfies $$ A_1(x) = \log\left(\frac{1}{1+\log(1-x)}\right). $$
$a_2(n)$ be A141209, i.e., an ...
0
votes
0
answers
198
views
Practical partial fraction decomposition
I have tried to implement Ramanujan's algorithm for Solvability of a system of polynomial equations but got stuck in the final step of calculating the partial fraction decomposition from which the ...
1
vote
0
answers
63
views
Algorithm for A111528 equivalent to algorithm for row polynomials of A111184
Let
$T(n,k)$ be A111528, i.e., integer coefficients such that $$ T(n,k) = \frac{k}{n} [x^k] \log \left( \sum \limits_{m=0}^{k} m! \binom{n+m-1}{m} x^m \right), \\ T(n,0) = 1, T(0,k) = k!. $$
$R(n,k)$ ...
4
votes
1
answer
399
views
On the growth of an algorithm
The origin of the following question is irrelevant and will hence be skipped. Hopefully, it will be interesting without context.
Consider the following algorithm. We will use $p_i$ to denote the $i$-...
2
votes
1
answer
127
views
Deciding whether rational periodic external rays of the Mandelbrot set land on primitive or satellite components
Given a rational angle $\theta = p/(2^n - 1)$ periodic under doubling, and the corresponding parameter ray $\mathcal{R}^{M}_{\theta}$ of the exterior of the Mandelbrot set, I have two related ...
1
vote
0
answers
53
views
Optimal triangulation of points distributed on two parallel lines
Question:
what is the fastest algorithm for optimally triangulating a point set $P$ that is given as the union of two sorted sequences $A\cup B\ :=\ ([0,0],[x_{a_1},0],\,\dots,\,[x_{a_m},0],[1,0])\,\...
3
votes
1
answer
308
views
On short cycles of Newton's method for root finding in characteristic $2$
While experimenting with Newton's method for root finding
$x \mapsto x-\frac{f(x)}{f'(x)}$ in positive characteristic,
we observed that in the oddest characteristic $2$ there
are always short cycles.
...
0
votes
0
answers
106
views
Double-looped algorithm for A000123
Let
$$ \ell(n) = \left\lfloor\log_2 n\right\rfloor. $$
$\operatorname{wt}(n)$ be A000120, i.e., number of ones in the binary expansion of $n$. Here $$ \operatorname{wt}(2n+1) = \operatorname{wt}(n) + ...
2
votes
2
answers
490
views
Reducing boundary artifacts in discrete‐Fourier (integer or fractional) derivatives
I am interested in calculating integer and fractional derivatives of a experimental data using discrete Fourier transform. There is a paper Calculating numerical derivatives using Fourier transform: ...
2
votes
1
answer
143
views
Lattice reduction in 3-dimensions with real basis vectors
There are several algorithms for lattice reductions in $n$-dimensions, LLL, etc. Here the lattice in question is in ${\mathbb R}^n$ and the basis vectors $b_1, \ldots, b_n$ are usually assumed to be ...
2
votes
0
answers
105
views
Generating totally balanced hypergraphs on $n$ vertices
Let $H=(V,E)$ be an hypergraph, where $V$ is the vertices set and $E$ is the hyperedge set. A special cycle of $H$ is a sequence
$
(v_1, e_1, v_2, e_2, \ldots, v_{k}, e_{k})
$,
with $k \geq 3$, where $...
0
votes
0
answers
79
views
Algorithms for generalized sieves (step of removing, position of remained term and $n$-th remained term)
Let
$a$ be an arbitrary non-decreasing integer sequence such that $a(1) = 2$. Here $a(n)$ is $n$-th term of $a$.
$b$ be an integer sequence of numbers $k$ such that $a(k+1)>a(k)$. Here $b(n)$ is $...
0
votes
0
answers
69
views
Algorithm for row polynomials of A259192
Let
$T(n,k)$ be A259192, whose ordinary generating function is $$A(x,y) = \frac{1 + xA(xy,y)}{1 - xA(xy,y)}. $$
Start with vector $\nu$ of fixed length $m$ with elements $\nu_i := \delta_{1,i}$, ...
2
votes
1
answer
498
views
Comparing two adjacency matrices for graph equality
I'm currently working on a project that partially involves graphs. One of the problems I'm tackling is determining whether two given matrices represent the same connected undirected graph.
So given ...
18
votes
2
answers
513
views
Number fields in fast matrix multiplication
A common approach to construct fast multiplication algorithms is to make an ansatz for the matrix multiplication tensor of fixed dimension and rank (e.g. $2 \times 2 \times 2$ and rank $7$ if we want ...
2
votes
0
answers
89
views
Fast and simple algorithm for A032188
Let
$a(n)$ be A032188 (i.e., number of labeled series-reduced mobiles (circular rooted trees) with $n$ leaves (root has degree $0$ or $\geqslant 2$)), whose exponential generating function is $A(x)$ ...
0
votes
0
answers
62
views
Algorithm for A048174 (number of labeled chains with $n$ edges)
Let
$a(n)$ be A048174 (i.e., number of labeled chains with $n$ edges), whose exponential generating function is $$ \frac{s}{1+s}, $$ where $$ s = \operatorname{SeriesReversion}\left(\log(1+x)-\frac{x^...
1
vote
1
answer
332
views
Generate all rooted trees with a given number of vertices
A graph $G$ is said to be a tree if it is a connected (i.e. every two distinct vertices of $G$ can be connected by a path of vertices of $G$), acyclic (i.e., $G$ has no cycles) and simple (i.e., $G$ ...
1
vote
0
answers
72
views
Similar elegant algorithms for A003159 and A003160
Let
$$ \ell(n) = \left\lfloor\log_2 n \right\rfloor .$$
$$ \nu_2(2n+1) = 0, \\ \nu_2(2n) = \nu_2(n) + 1. $$
$a(n)$ be A003159 (i.e., numbers whose binary representation ends in an even number of ...
1
vote
0
answers
158
views
Algorithm that allows to get any value of A000123 if finite number of values of A002577 are known
Let
$T(n,k)$ be an integer coefficients such that $$ T(n,k) = \begin{cases} 1 & \text{if } k = 0 \vee n = k \\ \displaystyle{ \sum\limits_{i=k-1}^{n-1} T(n-1,i) T(i,k-1) } & \text{otherwise} \...
0
votes
0
answers
94
views
Convergence rate of Hermitian QR iteration
Suppose $A$ is an $n \times n$ dimensional Hermitian matrix with $\|A\| \le 1$. I now consider the QR algorithm. I set $A_0 = A$ and at the $k$th step compute the QR decomposition $A_k = Q_k R_k$ and ...
22
votes
2
answers
2k
views
What is this modified arithmetico-geometric mean function?
I acquired a vintage programmable calculator and thought I'd give it a spin by computing some interesting transcendental function. I wanted to compute the arithmetico-geometric mean but the calculator ...
1
vote
1
answer
123
views
Counting multidimensional arrays up to reindexing and relabeling
Define a $d_0\times d_1\times\cdots\times d_{k-1}$-grid to be a surjective function $G$ with domain $\prod_{i=0}^{k-1}\{0,1,\dots,d_i-1\}$. A $d_0\times d_1\times\cdots\times d_{k-1}$-grid can also be ...
3
votes
0
answers
227
views
Show that at every equilibrium in the given sequential game, the first player weakly prefers his bundle to everyone else's
Suppose we have a set $N$ of $n$ players and a set $M$ of $m$ items. We are given a matrix $P_{n \times m}$ whose element $p_{ij} \geq 0$ $(i \in N, m \in M)$ denotes the valuation of good $j$ by ...
0
votes
0
answers
175
views
Fast Approximation Algorithm for Finding Largest Anti-Chain in a Finite Poset
Given a finite poset $(X, \prec)$ of size $n = |X|$, how efficiently can we compute a constant-factor approximation to the maximum antichain?
It is well-known that the size of the largest antichain ...
0
votes
0
answers
39
views
Time complexity of modified Floyd-Warshall that adds each time $K$ intermediate vertexes
I am trying to calculate the time complexity of the Floyd-Warshall algorithm with the following modification:
Instead of adding a single intermediate node each time, I will be adding $K$ nodes at once....
2
votes
0
answers
83
views
Algorithm for row polynomials of A253829
Let
$T(n,k)$ be A253829 whose ordinary generating function is $$ A(x,z) = \prod\limits_{n=1}^{\infty} \frac{1-z}{1-z-xz^n}. $$
$\nu$ be a vector of fixed length $m$ with elements $\nu_i = \delta_{1,i}...
1
vote
0
answers
71
views
Nonconvex analysis of primal averaging gradient descent algorithm
I've been looking at a specific optimization algorithm in the nonconvex setting, and I'm trying to analyze its convergence rate. Here's the quick setup:
Suppose we have a nonconvex, continuously ...
2
votes
1
answer
203
views
Conjectured graph transformations related to treewidth
This came when examining edge labeled graphs and is based on limited experimental evidence so counterexamples are likely.
Let $T(G)$ denote the treewidth of a graph.
Transformation (1) Set $G'=G$ and ...
2
votes
0
answers
88
views
Algorithm for A103239
Let $a(n)$ be A103239. Here
$$
1 = \sum\limits_{n=0}^{\infty} a(n) \frac{x^n}{(1-x)^n} \prod\limits_{j=0}^{n} (1 - (j+2)x).
$$
Start with $A$ and vector $\nu$ of fixed length $m$ with elements $\nu_i =...
0
votes
0
answers
57
views
Algorithm based on signed partial sums
Let $a(n)$ be an integer sequence with ordinary generating function $A(x)$ such that
$$
A(x) = \prod\limits_{k=1}^{\infty} \frac{1}{1+\frac{(-x)^k}{1-x}}.
$$
Start with vector $\nu$ of fixed length $m$...
-2
votes
1
answer
569
views
Does this specific 5-state Turing machine halt? [closed]
Basic setups:
A Turing machine M operates on a doubly infinite tape. The tape is divided into cells. Each cell can hold either a 0 or a 1 (meaning, we will consider only TM’s with two symbols). The ...
0
votes
0
answers
140
views
Complexity of number of primes in arithmetic progression under $P=NP$
Fix distinct primes $q_1,\dots,q_t\in[2^{m-1},2^m]$ and integers $r_i\in[0,q_i-1]$ at every $i\in\{1,\dots,t\}$.
Is there a way to exactly count the number of primes $a\equiv r_i\bmod q_i$ where $a\...
15
votes
1
answer
761
views
The most efficient algorithm for finding a root of a polynomial over finite field
I have a polynomial of degree around $2^{35}$ over a finite field $\mathbb{F}_p$, where $p$ is a 64-bit prime number.
What is the most efficient algorithm for finding a root of such a polynomial? (...
2
votes
1
answer
109
views
Finding the minimal representation of polynomials as a linear combination of shifted monomials
Question:
what is known about calculating from the real-valued coefficients of polynomial $P(x)$ in monomial form, i.e. $P(x)=\sum\limits_{i=0}^n c_ix^i$ the polynomial $Q(x)=\sum\limits_{i=0}^nd_i(...
1
vote
0
answers
134
views
Algorithm for inversion of A268407
Let $F(n)$ be A000045 (i.e., Fibonacci numbers). Here
$$
F(n) = F(n-1) + F(n-2), \\
F(0) = 0, F(1) = 1.
$$
Let $a(n)$ be A268407 (i.e., number of North-East lattice paths that do not bounce off the ...
10
votes
1
answer
582
views
An approach to numerical mathematics using only floating-point numbers from the outset?
When discussing the correctness, accuracy, condition, stability etc. of numerical algorithms, the arguments are usually performed in $\mathbb{R}$. Only when considering stability in the presence of ...