cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A363742 Number of integer factorizations of n with different mean, median, and mode.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 4, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 4, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 7
Offset: 1

Views

Author

Gus Wiseman, Jun 27 2023

Keywords

Comments

An integer factorization of n is a multiset of positive integers > 1 with product n.
If there are multiple modes, then the mode is automatically considered different from the mean and median; otherwise, we take the unique mode.
A mode in a multiset is an element that appears at least as many times as each of the others. For example, the modes in {a,a,b,b,b,c,d,d,d} are {b,d}.
The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).
Position of first appearance of n is: 1, 30, 48, 60, 72, 200, 160, 96, ...

Examples

			The a(n) factorizations for n = 30, 48, 60, 72, 96, 144:
  (2*3*5)  (2*3*8)    (2*5*6)    (2*4*9)    (2*6*8)    (2*8*9)
           (2*2*3*4)  (2*3*10)   (3*4*6)    (3*4*8)    (3*6*8)
                      (2*2*3*5)  (2*3*12)   (2*3*16)   (2*3*24)
                                 (2*2*3*6)  (2*4*12)   (2*4*18)
                                            (2*2*3*8)  (2*6*12)
                                            (2*2*4*6)  (3*4*12)
                                            (2*3*4*4)  (2*2*4*9)
                                                       (2*3*4*6)
                                                       (2*2*3*12)
                                                       (2*2*3*3*4)
		

Crossrefs

Just (mean) != (median): A359911, complement A359909, partitions A359894.
The version for partitions is A363720, equal A363719, ranks A363730.
For equal instead of unequal we have A363741.
A001055 counts factorizations, strict A045778, ordered A074206.
A316439 counts factorizations by length, A008284 partitions.
A363265 counts factorizations with a unique mode.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&, Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    modes[ms_]:=Select[Union[ms],Count[ms,#]>=Max@@Length/@Split[ms]&];
    Table[Length[Select[facs[n],{Mean[#]}!={Median[#]}!=modes[#]&]],{n,100}]
  • PARI
    median(lista) = if((#lista)%2, lista[(1+#lista)/2], (lista[#lista/2]+lista[1+(#lista/2)])/2);
    uniqmode(lista) = { my(freqs=Map(),v); for(i=1,#lista,if(!mapisdefined(freqs,lista[i],&v), v = 0); mapput(freqs,lista[i],1+v)); my(keys=Vec(freqs), fr, mc=0, mf=0, isuniq=0); for(i=1,#keys, fr = mapget(freqs,keys[i]); if(fr>=mf, isuniq = (fr>mf); mf = fr; mc = keys[i])); if(!isuniq, -1, mc); }; \\ Returns -1 if not unique mode.
    all_different(facs) = { my(mean=(vecsum(facs)/#facs), med=median(facs), mode=uniqmode(facs)); ((mean!=med) &&  (mean!=mode) && (med!=mode)); };
    A363742(n, m=n, facs=List([])) = if(1==n, (#facs>0 && all_different(Vec(facs))), my(s=0, newfacs); fordiv(n, d, if((d>1)&&(d<=m), newfacs = List(facs); listput(newfacs,d); s += A363742(n/d, d, newfacs))); (s)); \\ Antti Karttunen, Jan 29 2025

Extensions

More terms from Antti Karttunen, Jan 29 2025