OFFSET
1,4
COMMENTS
The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
The a(n) factorizations for n = 24, 36, 60, 120, 144, 360:
24 36 60 120 144 360
3*8 4*9 2*30 2*60 2*72 4*90
4*6 6*6 3*20 3*40 3*48 5*72
2*12 2*18 4*15 4*30 4*36 6*60
2*3*4 3*12 5*12 5*24 6*24 8*45
2*2*3*3 6*10 6*20 8*18 9*40
3*4*5 8*15 9*16 10*36
10*12 12*12 12*30
4*5*6 2*2*6*6 15*24
2*6*10 3*3*4*4 18*20
2*3*4*5 2*180
3*120
2*10*18
3*4*5*6
MATHEMATICA
facs[n_]:=If[n<=1, {{}}, Join@@Table[Map[Prepend[#, d]&, Select[facs[n/d], Min@@#>=d&]], {d, Rest[Divisors[n]]}]];
Table[Length[Select[facs[n], Mean[#]==Median[#]&]], {n, 100}]
PROG
(PARI)
median(lista) = if((#lista)%2, lista[(1+#lista)/2], (lista[#lista/2]+lista[1+(#lista/2)])/2);
A359909(n, m=n, facs=List([])) = if(1==n, (#facs>0 && (median(facs)==(vecsum(Vec(facs))/#facs))), my(s=0, newfacs); fordiv(n, d, if((d>1)&&(d<=m), newfacs = List(facs); listput(newfacs, d); s += A359909(n/d, d, newfacs))); (s)); \\ Antti Karttunen, Jan 20 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 24 2023
EXTENSIONS
More terms from Antti Karttunen, Jan 20 2025
STATUS
approved