Open problems / 016

The image of $a_m$

Let $a_m(n)$ be the least $k > n$ for which $n^\alpha k^\beta$ is an $m$-th power, for some $\alpha$ and $\beta$ between $1$ and $m-1$. Kagey asked which integers are values of $a_3$, whether every square is one, whether any squarefree number is, and what the image is for general $m$. For prime $m$ the relation behind $a_m$ is an equivalence and the answer is exact. For composite $m$ it is not even transitive.

The question

Fix $m \ge 2$. For a positive integer $n$, let

$$a_m(n) = \min\{\,k > n \;:\; n^\alpha k^\beta \text{ is an } m\text{-th power}\,\},$$

where the exponents run over $\alpha, \beta \in \{1, \dots, m-1\}$ and one pair that works is enough. For $m = 3$ the condition says that $nk$ or $nk^2$ is a cube. That sequence is A277781, beginning $8, 4, 9, 16, 25, 36, 49, 27, 24, 80$, and its image is A299117. The problem is about the image.

Is there another way to characterise the integers in A299117? Does A299117 contain every square? Does it contain any squarefree number? And for general $m$, what is the image of $a_m$?

All four have answers here. The first three are exact. The fourth is exact for prime $m$ and for $m = 4$, and for the other composite $m$ it is exact up to a set of density zero that we cannot describe in closed form.

Write $e_q(n)$ for the exponent of the prime $q$ in $n$, and let $v(n) = (e_q(n) \bmod m)_q$, an element of the group $G = \bigoplus_q \mathbb{Z}/m$. An integer is an $m$-th power exactly when its vector is zero, so the defining condition is

$$\alpha\, v(n) + \beta\, v(k) = 0.$$

Call $k$ a relative of $n$ when this holds for some pair from that range, and write $n \mathrel{R_m} k$. The relation is symmetric, and reflexive through $(\alpha, \beta) = (1, m-1)$. So $a_m(n)$ is the least relative of $n$ above $n$. Taking $\beta = m/p$ and $\alpha = m - m/p$ for a prime $p \mid m$ gives $n \mathrel{R_m} 2^p n$, so $a_m(n)$ exists and $a_m(n) \le 2^{p_0} n$, where $p_0$ is the least prime factor of $m$.

Prime $m$: one equivalence

Let $m = p$ be prime. Then $\alpha$ and $\beta$ are units mod $p$, so $\alpha v(n) + \beta v(k) = 0$ says $v(k) = c\,v(n)$ for some $c \in \mathbb{F}_p^\times$. That condition is visibly an equivalence relation.

$R_p$ is an equivalence relation. One class is the set of $p$-th powers, and the others are the lines through $0$ in $G$. The map $a_p$ sends $n$ to the next larger element of its class. It is injective, and its image is the set of integers that are not least in their class.

Injectivity is the only point needing an argument. If $a_p(n) = a_p(n') = k$ with $n < n'$, then $n'$ is a relative of $n$ lying strictly between $n$ and $k$, which contradicts the choice of $k$.

1, least in its class, not in the image18, in the image, that is in A299117827, in the image, that is in A2991172764, in the image, that is in A29911764125, in the image, that is in A299117125216, in the image, that is in A2991172162, least in its class, not in the image24, in the image, that is in A299117416, in the image, that is in A2991171632, in the image, that is in A2991173254, in the image, that is in A29911754108, in the image, that is in A2991171083, least in its class, not in the image39, in the image, that is in A299117924, in the image, that is in A2991172472, in the image, that is in A2991177281, in the image, that is in A29911781192, in the image, that is in A2991171925, least in its class, not in the image525, in the image, that is in A2991172540, in the image, that is in A29911740135, in the image, that is in A299117135200, in the image, that is in A299117200320, in the image, that is in A2991173206, least in its class, not in the image636, in the image, that is in A2991173648, in the image, that is in A29911748162, in the image, that is in A299117162288, in the image, that is in A299117288384, in the image, that is in A29911738412, least in its class, not in the image1218, in the image, that is in A2991171896, in the image, that is in A29911796144, in the image, that is in A299117144324, in the image, that is in A299117324486, in the image, that is in A299117486125102050100200500k, logarithmic
Six classes of the relation for $m = 3$, one to a row, on a logarithmic axis. Reading a row from the left, $a_3$ carries each element to the next one along. The hollow square that opens each row is the least element of that class, and it is the one element of the row that no $n$ maps to. The row through $12$ is the smallest case where a non-squarefree number is least in its class, which is why A299117 contains $18$ but not $12$.

The least elements can be named. For $1 \le c \le p-1$ put

$$n^{(c)} = \prod_q q^{\,(c\,e_q(n) \bmod p)}, \qquad \text{residues taken in } \{0, \dots, p-1\}.$$

Each $n^{(c)}$ lies in the class of $n$. Conversely an element $x$ of the class has $v(x) = c\,v(n)$ for some $c$, and then $e_q(x) \ge (c\,e_q(n) \bmod p)$ for every $q$, so that $n^{(c)}$ divides $x$.

The least element of the class of $n$ is $\min_{1 \le c \le p-1} n^{(c)}$. So the integers missing from the image of $a_p$ are exactly the $p$-th-power free $k$ for which no $k^{(c)}$ with $2 \le c \le p-1$ is smaller than $k$ itself.

For $p = 3$ that unwinds into a test one can apply by eye. Write a cubefree $k$ as $k = AB^2$ with $A$ and $B$ squarefree and coprime. Then $k^{(2)} = A^2B$, and $AB^2 \le A^2B$ exactly when $B \le A$.

$k$ is in A299117 if and only if $k$ is not cubefree, or $k = AB^2$ is cubefree with $B > A$. In particular $1$ is not in A299117.

The first non-squarefree numbers that A299117 misses are $12, 20, 28, 44, 45, 52$, the cubefree $AB^2$ with $1 < B < A$. Kagey's other two questions follow from the same test. If $k$ is squarefree then $k^{(c)} = k^c \ge k$ for every $c$, so $k$ is least in its class. If $k = t^j$ with $t > 1$ and $j \ge 2$, then either $p$ divides $j$, and $k$ is not $p$-th-power free, or $j$ is a unit mod $p$ and $t$ is a smaller element of the class of $k$.

For every prime $p$, no squarefree number is in the image of $a_p$, and every perfect power greater than $1$ is.

So for $m = 3$ the squarefree answer is no, and the square answer is yes with one exception. The exception is $1$. The problem page now carries an unsigned sketch of the $m = 3$ case that reaches the same description of the classes. It needs that one repair, both in its statement that every square lies in A299117 and in the note that the image contains every cube. The number $1$ is a square, a cube, and least in its class.

A conjecture in A343881

A343881 tabulates $T(m,k) = a_m(k)$. It records a conjecture that for fixed $k > 1$ and all sufficiently large primes $p$, $T(p,k)$ equals $k\operatorname{rad}(k)$, which is A064549. The published table stops short of $k = 12$, and every $k$ it does reach is a power of a squarefree number, where the conjecture is correct. It fails at $k = 12$.

Let $k > 1$, let $j$ be the least integer with $k = j^g$, and let $p > (g+1)(\log_2 j)^2$ be prime. Then $a_p(k) = kj$.

The proof bounds the exponents of any competitor $x$ with $k < x \le kj$ by $\log_2 x$, which is smaller than $p$, and then reads the congruences as exact equations. Since $\operatorname{rad}(k) = \operatorname{rad}(j) \le j$, with equality exactly when $j$ is squarefree, the conjecture holds for all large $p$ precisely when $k$ is a power of a squarefree number. For every other $k$ it fails for all large $p$, and $a_p(k) = kj > k\operatorname{rad}(k)$.

The smallest such $k$ is 12, where $j = 12$ and $g = 1$, so the theorem covers every prime from 29 up. Computation covers the rest: $a_5(12) = 54$, and $a_p(12) = 144$ for every prime $p$ between 7 and 101, where the conjecture predicts 72. At $p = 37$ it fails for exactly the $k \le 60$ that are not powers of squarefree numbers, namely 12, 18, 20, 24, 28, 40, 44, 45, 48, 50, 52, 54, 56 and 60.

Composite $m$: cliques

For composite $m$ the relation is no longer transitive, and $a_m$ is no longer injective. Let $g(n) = \gcd(m, e_q(n) : q \text{ prime})$, so the order of $v(n)$ in $G$ is $m/g(n)$. Let $\rho(n) = n^{1/g(n)}$, which is an integer, and let $D_m$ be the set of $n$ with $g(n) > 1$, that is, the integers that are a perfect $p$-th power for some prime $p \mid m$.

For $n \ne k$, $n \mathrel{R_m} k$ if and only if $n$ and $k$ both lie in $D_m$, or there is a prime $p$ dividing both $m/g(n)$ and $m/g(k)$ with $\rho(n) \mathrel{R_p} \rho(k)$.

The proof is a statement about cyclic groups. Two cyclic groups meet non-trivially exactly when they share a subgroup of prime order $p$, and $\langle v(n)\rangle$ has one exactly when $p \mid m/g(n)$. Under $\frac mp\mathbb{Z}/m \cong \mathbb{F}_p$ that subgroup is the line spanned by $v_p(\rho(n))$, and the lines for $n$ and $k$ agree exactly when $\rho(n) \mathrel{R_p} \rho(k)$.

So $R_m$ is a union of cliques: the set $D_m$, and one clique for each prime $p \mid m$ and each class of $R_p$ other than the $p$-th powers. An integer lies in at most $\omega(m) + 1$ of them, and lying in two is what breaks transitivity. For any prime $p \mid m$ with $p < m$ we have $2 \mathrel{R_m} 2^{m/p}$ and $2^{m/p} \mathrel{R_m} 1$, but not $2 \mathrel{R_m} 1$. Injectivity goes with it: $a_m(1) = a_m(2^{p_0-1}) = 2^{p_0}$.

Membership in the image is now a finite check rather than a single inequality.

$k$ is in the image of $a_m$ if and only if some clique containing $k$ has a largest element $n$ below $k$, and no clique containing $n$ meets the open interval $(n,k)$.

The integers with no smaller relative are still easy to name. Write $M_p$ for the set of least elements of the classes of $R_p$, and $M_m$ for the integers with no smaller relative. Then $M_m = \bigcap_{p \mid m} M_p$, which is the set of squarefree numbers whenever $m$ is even. The image is contained in the complement of $M_m$, so no squarefree number is a value of any $a_m$. For composite $m$ that inclusion is strict, and one whole family is missing.

If $m$ is composite, no $m$-th power is in the image of $a_m$.

So the square question fails for every composite $m$, since $u^{2m}$ is a square and an $m$-th power at once. For $m = 4$ the fourth powers are missing. For $m = 6$ the first integers with a smaller relative that are missing are $12, 49, 64, 80, 98$, and $49$ is a square.

The case $m = 4$

Here $D_4$ is the set of squares, and the other cliques are, for squarefree $s > 1$,

$$C_s = \{\,sy^2 : y \ge 1\,\} \cup \{\,s^2u^4 : u \ge 1\,\}.$$

A non-square $sy^2$ lies only in $C_s$. A square $r^2u^4$ with $r > 1$ squarefree lies in $D_4$ and in $C_r$. A fourth power lies only in $D_4$. That is little enough structure to settle the case outright.

The image of $a_4$ consists of the squares that are not fourth powers, together with the integers $k = st^2$ with $s > 1$ squarefree and $t \ge 2$ for which the open interval from $s(t-1)^2$ to $st^2$ does not contain two consecutive squares $q^2$ and $(q+1)^2$ with $q = su^2$ for an integer $u$.

squares1, not in the image, and has no smaller relative14, in the image of a_449, in the image of a_4916, not in the image, although it has a smaller relative1625, in the image of a_42536, in the image of a_43649, in the image of a_449C33, not in the image, and has no smaller relative39, in the image of a_4912, in the image of a_41227, in the image of a_42748, in the image of a_448C55, not in the image, and has no smaller relative520, in the image of a_42025, in the image of a_42545, not in the image, although it has a smaller relative45a4(9) = 12a4(25) = 3601020304050
Three cliques of the relation for $m = 4$ among the integers up to $50$: the squares, $C_3$ and $C_5$. The dashed uprights mark $9$ and $25$, the two integers here that lie in two of these three cliques. Each of them takes the smaller of its two candidate successors, drawn as the solid arrow, and the dashed arrow is the step it beats. The hollow squares are not values of $a_4$. For $1$, $3$ and $5$ that is because they have no smaller relative at all. For $16$ and $45$ it is because the only step that could have reached them was beaten.

The smallest $k$ caught by the second condition is $45$, whose interval $(20,45)$ contains $25$ and $36$. So the integers that have a smaller relative and are still missed by $a_4$ are the fourth powers $u^4$ with $u \ge 2$, together with 45, 54, 160, 176, 208 and so on. There are $855$ of them below $10^6$, of which $30$ are fourth powers.

How large the image is

Both cases give the same density, and it depends only on the least prime factor of $m$.

For every $m \ge 2$ the image of $a_m$ has natural density $1 - 1/\zeta(p_0)$, where $p_0$ is the least prime factor of $m$.

For prime $p$ the main term is the density $1 - 1/\zeta(p)$ of the integers that are not $p$-th-power free, all of which are in the image. What has to be counted is the $p$-th-power free $k \le X$ that are also in the image, which are the ones with $k^{(c)} < k$ for some $c \ge 2$. Write $k = sw$ with $s$ the product of the primes of exponent exactly $1$ and $w$ powerful. Such a $k$ has $s^2 \le k^{(c)} < k$, hence $s < w$, and there are $O(\sqrt Y)$ powerful numbers up to $Y$, which gives $O(X^{3/4})$ in all. For composite $m$ one further estimate is needed: if $w$ is divisible by a $p_0$-th power greater than $1$ and $s > w^2$, then $k$ is in the image. The integers failing that test number $O(X^{5/6})$, so the exceptional set $E_m$ of integers that have a smaller relative and are not values of $a_m$ has density zero.

0.00.10.20.30.4Xshare of the integers below X0.39207m = 40.16809m = 30.03561m = 510²10³10⁴10⁵10⁶
The share of the integers below $X$ that are values of $a_m$, for $m = 3$, $4$ and $5$, against the three densities proved above, drawn as dashed lines at $0.39207$, $0.16809$ and $0.03561$. The case $m = 4$ settles quickly, and from below. The other two come down from above and are still over their limits at $X = 10^6$, by $2.6$ per cent for $m = 3$ and by $12.7$ per cent for $m = 5$. The figure is drawn from the same $10^6$ runs that produced the first three rows of the table below, at $121$ values of $X$.

The convergence is slow when $p_0 \ge 3$, because the $p_0$-th-power free part of the image is a second-order term rather than nothing. In the table below, the column headed missed counts $E_m$ and the last column is the observed share of the image. The limit $1 - 1/\zeta(p_0)$ that share is heading for is $0.39207$ for $m = 4, 6, 12$, then $0.16809$ for $m = 3, 9, 15$, and $0.03561$ for $m = 5$.

mXvalues below Xmissedratio
3$10^6$172,39900.17240
4$10^6$391,2198550.39122
5$10^6$40,14400.04014
6$10^5$38,8723340.38872
9$10^5$17,712230.17712
12$10^5$38,6525540.38652
15$10^5$17,5082270.17508

For $m = 3$ that second-order term is the count of cubefree $AB^2$ with $A < B$. Counting coprime squarefree pairs in the region $A < B$, $AB^2 \le X$ suggests

$$\begin{aligned} \#\{k \le X : k \in \mathrm{A299117}\} &= \Bigl(1 - \frac{1}{\zeta(3)}\Bigr)X + c\,X^{2/3} + o(X^{2/3}),\\ c &= \tfrac32\prod_q\Bigl(1 - \frac{3}{q^2} + \frac{2}{q^3}\Bigr) = 0.4301\ldots \end{aligned}$$

The observed coefficient is $0.4297$ at $X = 10^5$ and $0.4306$ at $X = 10^6$. We have not written out the error analysis, so this is a heuristic and not a theorem.

What was checked

The values of $a_m$ were computed in three independent ways, and every count in the table was produced twice.

  • The first method scans $k = n+1, n+2, \dots$ and tests whether $n^\alpha k^\beta$ is an exact $m$-th power, in integer arithmetic, over all pairs $(\alpha, \beta)$. The second solves $\beta e_q(k) \equiv -\alpha e_q(n) \pmod m$ prime by prime for each pair and takes the least solution above $n$. Neither uses any result on this page. The third is the clique description above.
  • All three agree for $m \in \{2, \dots, 12, 15\}$ on initial ranges. The last two agree for $n \le 10^5$ when $m \in \{2,3,4,5,6,9,12,15\}$, and for $n \le 2 \cdot 10^4$ when $m \in \{7,8,10\}$.
  • The computation reproduces Kagey's table, the $57$ published terms of A277781, the first $20$ of A072905, every published term of A343881, and the $57$ published terms of A299117.
  • The membership test for prime $m$ was checked against the computed image up to $10^6$ for $m = 3, 5$ and up to $10^5$ for $m = 2, 7$, and the description of the image of $a_4$ up to $10^6$. For $m = 6, 9, 12, 15$, which have no such test, the counts at $10^5$ came from the clique engine and again from the congruence solver.
  • The structure theorem was checked against the definition for all pairs $n \ne k \le 40$ and $2 \le m \le 12$. On that range transitivity fails exactly for $m = 4, 6, 8, 9, 10, 12$. The description of $M_m$, the generic criterion behind the density, and the absence of $m$-th powers from the image were checked for $m \in \{4, 6, 8, 9, 10, 12, 15\}$ up to $10^5$.
  • The predictions were written down before the computations ran, in data/ledger.md. One numerical guess failed. It was a window for the $m = 5$ count at $10^6$, which the true value $40{,}144$ exceeds by $144$.

What is open

  • For composite $m \ne 4$ there is no closed description of $E_m$. The membership criterion reduces the question to at most $\omega(m) + 1$ predecessor computations, and the argument used for $m = 4$ should give explicit answers for $m = 6$, $8$ and $9$, with more cases to handle.
  • The counts for $m = 4$ and $m = 6$ suggest that $E_m$ has on the order of $\sqrt X$ elements below $X$. That is not proved for any composite $m$.
  • Which perfect powers other than the $m$-th powers lie in $E_m$ is not known.
  • The second-order term for $m = 3$ is a heuristic. The error analysis has not been written.