29

Let $\mathrm{gnu}(n)$ denote the number of groups of order $n$ up to isomorphism.

$\mathrm{gnu}(1), \mathrm{gnu}(2), \mathrm{gnu}(3), \dots$ is now a sequence of integers, and we may ask if and where the subsequence $1, 2, 3, \dots, k$ appears successively, for some integer $k$.

Just looking through the first few terms, it is not hard to find an instance of $1, 2, 3, 4$, namely $\mathrm{gnu}(73), \mathrm{gnu}(74), \mathrm{gnu}(75), \mathrm{gnu}(76)$. But $\mathrm{gnu}(77)=1$, so this is not a $1,2,3,4,5$.

To find $1,2,3,4,5$ is significantly harder. There are necessary and sufficient conditions on $n$ which determine whether $\mathrm{gnu}(n)=1,2,3,4$, listed for example in this paper on page 6. I implemented these to find the integers $n$ such that $\mathrm{gnu}(n+i)=i$ for $1 \leq i \leq 4$. I've written a computer program to find these - the sequence begins $n = 72, 20664, 66600, 84744, 89784, 141240, 175032, 232680, 271272, 288072, 378984,...$.

(Edit: I added this to the OEIS. See A373650.)

Note also that each term in this sequence is a multiple of $24$ - which helps us find these terms more easily. See here for details.

Hence our candidates for where we want to find a $5$ are at $77, 20669, 66605, 84749, 89789, 141245, 175037, 232685, 271277, 288077, 378989,...$.

I've tested these manually and, hoping that my calculations and program are correct, the earliest instance of a $1,2,3,4,5$ occurs at $\mathrm{gnu}(2814121), \mathrm{gnu}(2814122), \mathrm{gnu}(2814123), \mathrm{gnu}(2814124), \mathrm{gnu}(2814125)$. But $\mathrm{gnu}(2814126)=24$, so this is not a $1,2,3,4,5,6$.


The obvious next challenge is to find a $1,2,3,4,5,6$. That's a lot harder as:

  • I've struggled to find a necessary and sufficient condition for $\mathrm{gnu}(n)=5$ anywhere online (and am not sure on how to begin deriving it myself!)
  • As $n$ gets large, the tests for whether $\mathrm{gnu}(n)=1,2,3,4$ tend to take longer, since they're based on the prime factorization of $n$

So, I'm wondering if anyone has any observations that'd make finding a $1,2,3,4,5,6$ easier:

  • Is there a necessary and sufficient condition for $\mathrm{gnu}(n)=5$?
  • Is there some smarter method for how we may search for this?
Robin
  • 6,383
  • 11
    I have to admit that I cannot really understand why lots of people find this question (and also a related question,"does there exits $n>1$ with ${\rm gnu}(n)=n$?") interesting. Is it just curiosity? – Derek Holt Jun 12 '24 at 17:44
  • 3
    @DerekHolt There are tons of boring questions and overmore heavily opinion-based , and then there occurs a really interesting question like this (namely whether the sequence of gnus contains $1,2,3,4,5,6$ and , if , when it occurs first) and you find this "boring" ? Seems that people have a very different opinion concerning "interesting" and "boring". The upvotes need not mean that the users consider this "interesting" , the excellent presentation alone deserves a high score. We need more of such questions ! – Peter Jun 13 '24 at 14:24
  • 1
    The related question was posted by me but I was not the first. It is an old still open problem whether $gnu(n)=n$ has a nontrivial solution , but I did not know this. I independently arrived at this question which I consider both natural and fascinating. – Peter Jun 13 '24 at 14:30
  • 8
    @Peter I did not use the word "boring", and I do not find the problem boring. I was hoping that someone would say why they find the question interesting. – Derek Holt Jun 13 '24 at 16:07
  • 1
    Similarly to many elementary questions in number theory (for example: are there infinitely many primes of the form $n^2+1$), it can be very difficult to say anything interesting about questions of this type. The question might become interesting if a solution is found.. – testaccount Jun 15 '24 at 10:25
  • 3
    @Peter, maybe one reason for Derek's point is that one might ask the same for any sequence $a_1,\dots,a_k$. – Kan't Apr 19 '25 at 11:55
  • 3
    https://oeis.org/A381335 tabulates Integers $k$ such that there are $i$ groups of order $k+i$ up to isomorphism, for $i=1,2,3,4,5$. – Gerry Myerson May 23 '25 at 11:30
  • 2
    @GerryMyerson Yeah, I submitted that sequence (should add it). If anyone can contribute more to that sequence it’d be much appreciated :) – Robin May 23 '25 at 14:34
  • …by add, I mean add in the body of the post somewhere. See also the related sequences A373648 (i=1,2), A373649 (i=1,2,3), A373650 (i=1,2,3,4). – Robin May 23 '25 at 16:18
  • 2
    Note that $\text{gnu}(i + k) = k$ for k = 1,2,3,4,5,6 and for i = [29436120, 117873720, 222954120, 324510120, 689250312, 876688920, 894332520, 946770120] if my computations are correct. – Husnain Raza Dec 02 '25 at 01:11

4 Answers4

7

Found one!

$$\begin{aligned} \mathrm{gnu}(29436121) &= 1 \\ \mathrm{gnu}(29436122) &= 2 \\ \mathrm{gnu}(29436123) &= 3 \\ \mathrm{gnu}(29436124) &= 4 \\ \mathrm{gnu}(29436125) &= 5 \\ \mathrm{gnu}(29436126) &= 6 \end{aligned}$$

But $\mathrm{gnu}(29436127) = 1$, so this is not a $1,2,3,4,5,6,7$.

Magma is capable of calculating these orders, if you want to verify my answer, go here and enter

NumberOfSmallGroups(29436121);
NumberOfSmallGroups(29436122);
NumberOfSmallGroups(29436123);
NumberOfSmallGroups(29436124);
NumberOfSmallGroups(29436125);
NumberOfSmallGroups(29436126);

If all of my calculations are correct, then this is the first $1,2,3,4,5,6$.

Robin
  • 6,383
6

Edit: Since writing this, I have found a $1,2,3,4,5,6$. See this other answer.


This isn't an answer as to whether a $1,2,3,4,5,6$ occurs or not, but in my question I wrote:

$\mathrm{gnu}(1),\mathrm{gnu}(2),\mathrm{gnu}(3),\dots$ is now a sequence of integers, and we may ask if and where the subsequence $1,2,3,\dots,k$ appears successively, for some integer $k$.

I just realised that there's a fairly simple argument to show we can't get arbitrarily large $k$ which is probably worth noting.

Observe that $\mathrm{gnu}(32) = 51$. Thus, for all $n$, $\mathrm{gnu}(32n) \geq 51$.

But then, for any $N$, $\mathrm{gnu}(N+1), \dots, \mathrm{gnu}(N+32)$ can't be a $1,2,\dots,32$, as one of $N+1, \dots, N+32$ is a multiple of $32$ and hence has at least $51$ groups.

$32$ is the smallest $k$ such that $\mathrm{gnu}(k) > k$ hence why I picked it for this argument. It's possible we can lower this upper bound for $k$ further, though.

Another edit: Actually, we can lower this to show a $1,2,3,4,5,6,7,8$ must never appear. If $n$ has $\mathrm{gnu}(n+i) = i$ for $i=1,2,3,4$, it is possible to show $n=48m+24$ for some $m$. See here for some partial discussion on that. It follows that $16 \mid n+8$. One can then show that $\mathrm{gnu}(16l) \geq 14$ for any $l$. Hence $\mathrm{gnu}(n+8) \neq 8$. I’ve not found a $1,2,3,4,5,6,7$ yet - it’s possible $1,2,3,4,5,6$ is the longest we can get.


As for finding a $1,2,3,4,5,6$, I've started running another brute force search. I've only found one other $1,2,3,4,5$:

$$\begin{aligned} \mathrm{gnu}(22411273) &= 1 \\ \mathrm{gnu}(22411274) &= 2 \\ \mathrm{gnu}(22411275) &= 3 \\ \mathrm{gnu}(22411276) &= 4 \\ \mathrm{gnu}(22411277) &= 5 \\ \end{aligned}$$

But $\mathrm{gnu}(22411278) \geq 16$ because e.g. $22411278 = 2 \cdot 3^2 \cdot 61 \cdot 20411 = 1098 \cdot 20411$, $\mathrm{gnu}(1098) = 16$ (https://oeis.org/A000001) so this is not a $1,2,3,4,5,6$.

A third $1,2,3,4,5$ does not occur below $2.9 \times 10^7$.

Edit: I just found the third $1,2,3,4,5$ which happens to also be a $1,2,3,4,5,6$. See my other answer.

Robin
  • 6,383
6

I found $9$ cases up to $3\times10^{14}$ with a sequence of $7$ consecutive gnu values: $$5973822114120,6305771634120,28058687347320,48414128744520,74556478687320,84300170172120,142366076070120,153432090884520,207916418382120.$$

This proves that sequences of $7$ numbers exist, but sequences of $8$ do not.

To find these, I used a sieve that finds $n$ where $n+2$, $n+4$, and $n+6$ definitely have the right group number, and $n+1$ is squarefree. I'll describe this in a bit more detail after I describe my original sieve.

Outdated Original Approach (good up to about $10^{12}$):

Before that, I made a really complicated sieve that identifies 3-group numbers by chugging through the conditions in a clever way. We know that $n$ is a 3-group number iff one of the following holds

  • I: $n$ is squarefree aside from one square factor $q^2$, there are no relations, and exactly one prime divisor of $n$ divides $q+1$.
  • II: $n$ is squarefree with a "chain" of relations, ie $p\mid q-1$ and $q\mid r-1$ for three of its prime factors $p$, $q$, and $r$, but there are no other relations of this type.

I ran a separate sieve in each of these cases, with multiple passes each. In case I, we 1) identify $q$ and any prime factor larger than $\sqrt{\mathrm{MAX}}$ that exists, 2) compute "reduced phi" $\not\varphi(n)=\prod_{p^a\mid n}(p-1)$ and "count" how many prime divisors of $n$ divide $q+1$ (using a 1-bit counter since if 2 are found we mark n as invalid). In case II, we 1) compute $\varphi(n)$ or identify that $n$ is not squarefree, and compute the large prime factor if it exists, 2) identify the primes $p$ and $q$ that multiply to $\gcd(\varphi(n),n)$ and are related, or identify that it's not a semiprime with related factors, 3) count the prime divisors related to $p$ and $q$ and ensure there is one each.

The multiple passes are to avoid any kind of actual factoring or trial division, and to minimize memory usage: the type I sieve uses 64 bits per $n$ and the type II sieve uses 80. The fewer bits we use, the more entries we can store in a segment before we have to use smaller segments (if the segment does not fit in CPU cache, the program performs dramatically worse).

Ultimately, that method is not great, since about $\frac 1{300}$ numbers is a 3-group number, so we are doing pretty expensive work to eliminate not much.

Current Approach (good up to about $10^{15}$):

Looking into Robin's related question here (see my answer for some more context), I extended the results and found something quite amazing. If $\mathrm{gnu}(n+1)=1$, $\mathrm{gnu}(n+2)=2$, $\mathrm{gnu}(n+4)=4$, and $\mathrm{gnu}(n+6)=6$, we have:

  • $n = 144m+72$
  • $n+1=144m+73$ is squarefree (necessary but not sufficient for $n+1$ condition)
  • $n+2=2(72m+37)$ is $2$ times a prime (necessary AND sufficient)
  • $n+4=4(36m+19)$ is $4$ times a prime (necessary and sufficient)
  • $n+6=6(24m+13)$ is $6$ times a prime (necessary and sufficient)

This basically divides the upper bound by $144$ since we work in terms of $m$ instead of $n$. And it gives us a really simple sieve:

  • for every prime $p>3$, mark all $m$ where $p^2\mid144m+73$, $p\mid72m+37$, or etc as invalid
  • once we do this for every prime up to $\sqrt{\mathrm{MAX}}$, any $m$ which are not marked as invalid are candidates, and we should check that they produce $n$ with the $n+3$, $n+5$, and $n+1$ conditions met.

My answer on the other question goes into more detail on when gnu equals 4 and 6. The important thing is we know fully the powers of 2 and 3 that divide our numbers. For even numbers, 2 is related to every odd prime so the factorization is really restricted. The cases for $n+5$ and $n+7$ simplify since we know those are odd, but they don't actually simplify that much.

In practice I'm using a parallel segmented sieve with 32 threads, and the threads process segments until they have >= 200000 candidates (or there are no more segments), and then filter their list of candidates, to minimize switching between the sieving and factorization based tests.

I only ran it up to $10^{14}$ which took 8 minutes, but it should be able to do $10^{15}$ in only an hour or two. Using an $m\mod385$ wheel could make it almost 4x faster, and it might be possible to mix in sieves to check or partially check the $n+3$ case, but this would be complicated.

Asymptotics

The four sieves I do use, based on the forms $144m+73$, $72m+37$, etc, show that $\mathrm{gnu}(n+1)=1$, $\mathrm{gnu}(n+2)=2$, $\mathrm{gnu}(n+4)=4$, and $\mathrm{gnu}(n+6)$ are NOT independent conditions. The proportion of numbers having a fixed gnu value seems to converge to a constant, but the proportion of numbers where $n+1$ is squarefree and $n+2$, $n+4$, and $n+6$ have the correct group numbers is related to $$\prod_{5\le p\le\mathrm{MAX}}\left(1-\frac{3p+1}{p^2}\right).$$ I don't know enough about primes in arithmetic progressions to know the exact connection. It definitely shows that these candidate numbers get rarer as they get larger, since this is true for primes in an arithmetic progression alone. I think it shows there are infinitely many candidates, but I'm not sure about that.

In practice, it's MUCH more effective at filtering out $n$ values that don't work compared to the original 3-group sieve.

Up to $1.44\times10^9$, there are about $4.8\times10^6$ 3-group numbers, but there are only $2.47\times10^4$ candidates with the new sieve. And this only gets better for larger upper bounds.

In particular, I think the number of candidates up to $M$ is $O(\frac M{\log(M)^3})$.

Finally, how rare are candidate $n$ where one or more of the constraints $\mathrm{gnu}(n+1)=1$, $\mathrm{gnu}(n+3)=3$, $\mathrm{gnu}(n+5)=5$, and $\mathrm{gnu}(n+7)=7$ hold? We know that the even constraints plus the $n+1$ constraint are not independent, but what about the rest? Does each additional constraint have some constant density among candidates, but the overall density goes down even among candidates? Are there infinitely many sequences of $7$ consecutive gnu values?

We can actually show that there are infinitely many 7 sequences, ASSUMING the Bateman-Horn conjecture. Just consider a subsequence where $n = 233992702112400m + 1301555283912$ and all of $233992702112400m + 1301555283913$, $116996351056200m + 650777641957$, $15599513474160m + 86770352261$, $58498175528100m + 325388820979$, $682194466800m + 3794621819$, $38998783685400m + 216925880653$, and $4088422800m + 22741343$ are prime. We NEED $n = 72\mod144$, which forces $n+2$, $n+4$, and $n+6$ to be good, and constrains it mod powers of $2$ and $3$. So I constrained $n$ mod $5^2$ so that $n+3$ would have $3$ groups if some linear form is prime, then mod $7^4$ so that $n+5$ would have $5$ groups, then $11^443^2$ so that $n+7$ would have $7$ groups. If you take $n+i$ for $i=1,\ldots,7$ and factor out the gcd from $n+i=am+b$, you get $n+i=k(a'm+b')$ where $g(k)=i$ and if $a'm+b'$ is prime it does not interact with $k$.

If all $7$ of these linear forms are prime, then $g(n+1)=1,\ldots,g(n+7)=7$. There are certainly many terms that this construction does not generate, but it's now easy to see we have infinite terms assuming Bateman-Horn.

Edit 1

  • Searched $10^{14}+1$ thru $2\times10^{14}$ and found $2$ more sequences of $7$
  • added references including source code
  • Proved sequence is infinite assuming Bateman-Horn conjecture (can probably use a weaker assumption)

References:

hacatu
  • 859
2

Here's another one.

$$\begin{aligned} \mathrm{gnu}(117873721) &= 1 \\ \mathrm{gnu}(117873722) &= 2 \\ \mathrm{gnu}(117873723) &= 3 \\ \mathrm{gnu}(117873724) &= 4 \\ \mathrm{gnu}(117873725) &= 5 \\ \mathrm{gnu}(117873726) &= 6 \end{aligned}$$

But $\mathrm{gnu}(117873727) = 1$, so this is not a $1,2,3,4,5,6,7$.

Magma is capable of calculating these orders except $117873723$, if you want to verify most of my answer, go here and enter

NumberOfSmallGroups(117873721);
NumberOfSmallGroups(117873722);
NumberOfSmallGroups(117873723);
NumberOfSmallGroups(117873724);
NumberOfSmallGroups(117873725);
NumberOfSmallGroups(117873726);

and you'll get 1 2 0 4 5 6.

However, as I said, this paper has conditions for precisely when $\mathrm{gnu}(n)=3$, and you can verify $117873723$ passes them.

If all of my calculations are correct, then this is the second $1,2,3,4,5,6$.

Robin
  • 6,383