%I #36 Sep 23 2023 03:48:13
%S 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,
%T 0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,
%U 0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0
%N Number of Hamiltonian groups of order n.
%D Robert D. Carmichael, Introduction to the Theory of Groups of Finite Order, New York, Dover, 1956.
%D John C. Lennox and Stewart. E. Stonehewer, Subnormal Subgroups of Groups, Oxford University Press, 1987.
%H T. D. Noe, <a href="/A104488/b104488.txt">Table of n, a(n) for n = 1..10000</a>
%H Boris Horvat, Gašper Jaklič, and Tomaž Pisanski, <a href="https://hrcak.srce.hr/clanak/1339">On the number of hamiltonian groups</a>, Mathematical Communications, Vol. 10, No. 1 (2005), pp. 89-94; <a href="https://arxiv.org/abs/math/0503183">arXiv preprint</a>, arXiv:math/0503183 [math.CO], 2005.
%H Tomaž Pisanski and Thomas W. Tucker, <a href="https://doi.org/10.1016/0012-365X(89)90173-8">The genus of low rank hamiltonian groups</a>, Discrete Math. 78 (1989), 157-167.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HamiltonianGroup.html">Hamiltonian Group</a>.
%F Let n = 2^e*o, where e = e(n) >= 0 and o = o(n) is an odd number. The number h(n) of Hamiltonian groups of order n is given by h(n) = 0, if e(n) < 3 and h(n) = a(o(n)), otherwise, where a(n) = A000688(n) denotes the number of Abelian groups of order n.
%F a(8*n) = A000688(A000265(n)), a(n) = 0 for n mod 8 <> 0. - _Andrew Howroyd_, Aug 08 2018
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A021002 * A048651 / 4 = 0.16568181590156732257... . - _Amiram Eldar_, Sep 23 2023
%t orders[n_]:=Map[Last, FactorInteger[n]]; a[n_]:=Apply[Times, Map[PartitionsP, orders[n]]]; e[n_]:=n/ 2^IntegerExponent[n, 2]; h[n_]/;Mod[n, 8]==0:=a[e[n]]; h[n_]:=0;
%t (* Second program: *)
%t a[n_] := If[Mod[n, 8]==0, FiniteAbelianGroupCount[n/2^IntegerExponent[n, 2]], 0]; Array[a, 102] (* _Jean-François Alcover_, Sep 14 2019 *)
%o (PARI) a(n)={my(e=valuation(n, 2)); if(e<3, 0, my(f=factor(n/2^e)[, 2]); prod(i=1, #f, numbpart(f[i])))} \\ _Andrew Howroyd_, Aug 08 2018
%Y Cf. A000265, A000688, A021002, A048651, A104404, A104404, A104452, A104453.
%K nonn,easy,nice
%O 1,72
%A Boris Horvat (Boris.Horvat(AT)fmf.uni-lj.si), Gasper Jaklic (Gasper.Jaklic(AT)fmf.uni-lj.si), _Tomaz Pisanski_, Apr 19 2005