%I #76 May 13 2023 23:50:05
%S 4,6,9,10,14,21,22,25,26,34,38,39,45,46,49,55,57,58,62,74,82,86,93,94,
%T 99,105,106,111,118,121,122,129,134,142,146,153,155,158,165,166,169,
%U 175,178,183,194,195,201,202,203,205,206,207,214,218,219,226,231,237
%N Numbers m such that there are precisely 2 groups of order m.
%C Givens characterizes this sequence, see Theorem 5. In particular, this sequence is ({n: A215935(n) = 1} INTERSECT A005117) UNION (A060687 INTERSECT A051532). - _Charles R Greathouse IV_, Aug 27 2012 [This is now A350586 UNION A350322. - _Charles R Greathouse IV_, Jan 08 2022]
%C Numbers m such that A000001(m) = 2. - _Muniru A Asiru_, Nov 03 2017
%H Muniru A Asiru and Gheorghe Coserea, <a href="/A054395/b054395.txt">Table of n, a(n) for n = 1..234567</a>, terms 1..422 from Muniru A Asiru.
%H H. U. Besche, B. Eick and E. A. O'Brien, <a href="http://www.icm.tu-bs.de/ag_algebra/software/small/">The Small Groups Library</a>
%H Clint Givens, <a href="https://pdfs.semanticscholar.org/06ac/b99db5cf1946d85413729990a0d95860702b.pdf">Orders for which there exist exactly two groups</a> (2006)
%H Gordon Royle, <a href="http://staffhome.ecm.uwa.edu.au/~00013890/remote/cubcay/">Numbers of Small Groups</a>
%H <a href="/index/Gre#groups">Index entries for sequences related to groups</a>
%e For m = 4, the 2 groups of order 4 are C4, C2 x C2; for m = 6, the 2 groups of order 6 are S3, C6; and for m = 9, the 2 groups of order 9 are C9, C3 x C3 where C is the cyclic group of the stated order and S is the symmetric group of the stated degree. The symbol x means direct product. - _Muniru A Asiru_, Oct 24 2017
%t Select[Range[240], FiniteGroupCount[#] == 2&]
%t (* or: *)
%t okQ[n_] := Module[{p, f}, p = GCD[n, EulerPhi[n]]; If[! PrimeQ[p], Return[False]]; If[Mod[n, p^2] == 0, Return[1 == GCD[p + 1, n]]]; f = FactorInteger[n]; 1 == Sum[Boole[Mod[f[[k, 1]], p] == 1], {k, 1, Length[f]}]];
%t Select[Range[240], okQ] (* _Jean-François Alcover_, Dec 08 2017, after _Gheorghe Coserea_ *)
%o (GAP) A054395 := Filtered([1..2015], n -> NumberSmallGroups(n) = 2); # _Muniru A Asiru_, Oct 24 2017
%o (GAP)
%o IsGivensInt := function(n)
%o local p, f; p := GcdInt(n, Phi(n));
%o if not IsPrimeInt(p) then return false; fi;
%o if n mod p^2 = 0 then return 1 = GcdInt(p+1, n); fi;
%o f := PrimePowersInt(n);
%o return 1 = Number([1..QuoInt(Length(f),2)], k->f[2*k-1] mod p = 1);
%o end;;
%o Filtered([1..240], IsGivensInt); # _Gheorghe Coserea_, Dec 04 2017
%o (PARI)
%o is(n) = {
%o my(p=gcd(n,eulerphi(n)), f);
%o if (!isprime(p), return(0));
%o if (n%p^2 == 0, return(1 == gcd(p+1, n)));
%o f = factor(n); 1 == sum(k=1, matsize(f)[1], f[k,1]%p==1);
%o };
%o seq(N) = {
%o my(a = vector(N), k=0, n=1);
%o while(k < N, if(is(n), a[k++]=n); n++); a;
%o };
%o seq(58) \\ _Gheorghe Coserea_, Dec 03 2017
%Y Equals A350586 UNION A350322.
%Y Cf. A000001. Cyclic numbers A003277. Numbers m such that there are precisely k groups of order m: this sequence (k=2), A055561 (k=3), A054396 (k=4), A054397 (k=5), A135850 (k=6), A249550 (k=7), A249551 (k=8), A249552 (k=9), A249553 (k=10), A249554 (k=11), A249555 (k=12), A292896 (k=13), A294155 (k=14), A294156 (k=15), A295161 (k=16), A294949 (k=17), A298909 (k=18), A298910 (k=19), A298911 (k=20).
%K nonn
%O 1,1
%A _N. J. A. Sloane_, May 21 2000
%E More terms from _Christian G. Bower_, May 25 2000