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.

A200744 Divide integers 1..n into two sets, minimizing the difference of their products. This sequence is the larger product.

This page as a plain text file.
%I A200744 #43 Jul 15 2023 16:57:14
%S A200744 1,2,3,6,12,30,72,210,630,1920,6336,22176,79200,295680,1146600,
%T A200744 4586400,18869760,80061696,348986880,1560176640,7148445696,
%U A200744 33530112000,160825785120,787718131200,3938590656000,20083261440000,104351247000000,552173794099200,2973528918360000,16286983961149440
%N A200744 Divide integers 1..n into two sets, minimizing the difference of their products. This sequence is the larger product.
%H A200744 Max Alekseyev, <a href="/A200744/b200744.txt">Table of n, a(n) for n = 1..140</a> (terms for n = 1..35 from Michael S. Branicky)
%F A200744 a(n) = A127180(n) - A200743(n) = A038667(n) + A200743(n) = (A038667(n) + A127180(n)) / 2. - _Max Alekseyev_, Jun 18 2022
%e A200744 For n=1, we put 1 in one set and the other is empty; with the standard convention for empty products, both products are 1.
%e A200744 For n=13, the central pair of divisors of n! are 78975 and 78848. Since neither is divisible by 10, these values cannot be obtained. The next pair of divisors are 79200 = 12*11*10*6*5*2*1 and 78624 = 13*9*8*7*4*3, so a(13) = 79200.
%p A200744 a:= proc(n) local l, ll, g, p, i; l:= [i$i=1..n]; ll:= [i!$i=1..n]; g:= proc(m, j, b) local mm, bb, k; if j=1 then m else mm:= m; bb:= b; for k to 2 while (mm<p) do if j=2 or k=2 or k=1 and ll[j-1]*mm>bb then bb:= max(bb, g(mm, j-1, bb)) fi; mm:= mm*l[j] od; bb fi end; Digits:= 700; p:= ceil(sqrt(ll[n])); ll[n]/ g(1, nops(l), 1) end: seq(a(n), n=1..23);  # _Alois P. Heinz_, Nov 22 2011
%t A200744 a[n_] := a[n] = Module[{s, t}, {s, t} = MinimalBy[{#, Complement[Range[n], #]}& /@ Subsets[Range[n]], Abs[Times @@ #[[1]] - Times @@ #[[2]]]&][[1]]; Max[Times @@ s, Times @@ t]];
%t A200744 Table[Print[n, " ", a[n]];
%t A200744 a[n], {n, 1, 25}] (* _Jean-François Alcover_, Nov 07 2020 *)
%o A200744 (Python)
%o A200744 from math import prod, factorial
%o A200744 from itertools import combinations
%o A200744 def A200744(n):
%o A200744     m = factorial(n)
%o A200744     return min((abs((p:=prod(d))-m//p),max(p,m//p)) for l in range(n,n//2,-1) for d in combinations(range(1,n+1),l))[1] # _Chai Wah Wu_, Apr 07 2022
%Y A200744 Cf. A060777, A060796, A038667, A127180, A200743.
%K A200744 nonn
%O A200744 1,2
%A A200744 _Franklin T. Adams-Watters_, Nov 21 2011
%E A200744 a(24)-a(30) from _Alois P. Heinz_, Nov 22 2011