login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers k delivering the records in the number of partitions of divisors of k into two sets of size > 1 with an integer arithmetic mean in each set.
0

%I #28 Feb 03 2024 10:17:09

%S 1,6,12,18,20,24,30,42,48,60,120,180,240,360,420,480,504,540,630,720,

%T 840,1080,1260,1440,1680,2160,2520,5040,7560,10080,15120,20160

%N Numbers k delivering the records in the number of partitions of divisors of k into two sets of size > 1 with an integer arithmetic mean in each set.

%C The corresponding record values are 0, 1, 3, 4, 6, 16, 20, 21, 29, 198, 1542, 3448, 9055, 86081, 245107, 245145, 245336, 249208, 250595, 4844170, 31669733, ...

%e 6 is the smallest number whose set of divisors can be partitioned into two disjoint sets whose arithmetic means are both integers: {1, 3} and {2, 6}.

%e 12 is the smallest number whose set of divisors can be partitioned into two disjoint sets whose arithmetic means are both integers in three ways: ({1, 3}, {2, 4, 6, 12}), ({2, 6}, {1, 3, 4, 12}) and ({4, 12}, {1, 2, 3, 6}).

%t q[d_] := Length[d] > 1 && IntegerQ @ Mean[d]; c[n_] := Count[Subsets[(d = Divisors[n])], _?(q[#] && q[Complement[d, #]] &)]/2; cm = -1; s = {}; Do[If[(c1 = c[n]) > cm, cm = c1; AppendTo[s, n]], {n, 1, 240}]; s

%o (Python)

%o from itertools import count, islice, combinations

%o from sympy import divisors

%o def A348719_gen(): # generator of terms

%o c = 0

%o yield 1

%o for n in count(2):

%o divs = tuple(divisors(n, generator=True))

%o l, b = len(divs), sum(divs)

%o if l>=4 and 2**(l-1)-l>c:

%o m = sum(1 for k in range(2,(l-1>>1)+1) for p in combinations(divs,k) if not ((s:=sum(p))%k or (b-s)%(l-k)))

%o if l&1 == 0:

%o k = l>>1

%o m += sum(1 for p in combinations(divs,k) if 1 in p and not ((s:=sum(p))%k or (b-s)%k))

%o if m > c:

%o yield n

%o c = m

%o A348719_list = list(islice(A348719_gen(),10)) # _Chai Wah Wu_, Sep 24 2023

%Y Cf. A348716, A348718.

%K nonn,more

%O 1,2

%A _Amiram Eldar_, Oct 31 2021

%E a(22)-a(23) from _Chai Wah Wu_, Sep 24 2023

%E a(24) from _Chai Wah Wu_, Sep 26 2023

%E a(25)-a(32) added and definition corrected by _Max Alekseyev_, Feb 01 2024