login
a(n) is the smallest integer that can be written as a product of n distinct integers > 1 in at least two different ways.
1

%I #16 Jan 18 2021 18:05:17

%S 12,48,240,1440,8640,60480,604800,5443200,59875200,718502400,

%T 9340531200,124540416000,1743565824000,29640619008000,502146957312000,

%U 8536498274304000,162193467211776000,3406062811447296000,68121256228945920000,1498667637036810240000

%N a(n) is the smallest integer that can be written as a product of n distinct integers > 1 in at least two different ways.

%H James Rayman, <a href="/A340727/b340727.txt">Table of n, a(n) for n = 2..400</a>

%e a(2) = 12 since 12 = 2*6 = 3*4.

%e a(4) = 240 since 240 = 2*3*4*10 = 2*3*5*8.

%o (Python)

%o from heapq import *

%o import math

%o def a(n):

%o prev, visited, v = 0, set(), list(range(2, n+2))

%o pq = [(math.factorial(n+1), v)]

%o while True:

%o prod, v = heappop(pq)

%o if tuple(v) in visited: continue

%o visited.add(tuple(v))

%o if prev != prod: prev = prod

%o else: return prod

%o for i in range(n):

%o if i == n-1 or v[i] + 1 < v[i+1]:

%o u = v[:]

%o u[i] += 1

%o heappush(pq, (prod // v[i] * u[i], u))

%Y Cf. A081957.

%K nonn

%O 2,1

%A _James Rayman_, Jan 17 2021