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.

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

Original entry on oeis.org

12, 48, 240, 1440, 8640, 60480, 604800, 5443200, 59875200, 718502400, 9340531200, 124540416000, 1743565824000, 29640619008000, 502146957312000, 8536498274304000, 162193467211776000, 3406062811447296000, 68121256228945920000, 1498667637036810240000
Offset: 2

Views

Author

James Rayman, Jan 17 2021

Keywords

Examples

			a(2) = 12 since 12 = 2*6 = 3*4.
a(4) = 240 since 240 = 2*3*4*10 = 2*3*5*8.
		

Crossrefs

Cf. A081957.

Programs

  • Python
    from heapq import *
    import math
    def a(n):
        prev, visited, v = 0, set(), list(range(2, n+2))
        pq = [(math.factorial(n+1), v)]
        while True:
            prod, v = heappop(pq)
            if tuple(v) in visited: continue
            visited.add(tuple(v))
            if prev != prod: prev = prod
            else: return prod
            for i in range(n):
                if i == n-1 or v[i] + 1 < v[i+1]:
                    u = v[:]
                    u[i] += 1
                    heappush(pq, (prod // v[i] * u[i], u))