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.

A363501 a(n) = smallest product > n of some subset of the divisors of n, or if no product > n exists then a(n) = n.

Original entry on oeis.org

1, 2, 3, 8, 5, 12, 7, 16, 27, 20, 11, 18, 13, 28, 45, 32, 17, 27, 19, 40, 63, 44, 23, 32, 125, 52, 81, 56, 29, 36, 31, 64, 99, 68, 175, 48, 37, 76, 117, 50, 41, 63, 43, 88, 75, 92, 47, 64, 343, 100, 153, 104, 53, 81, 275, 64, 171, 116, 59, 72, 61, 124, 147
Offset: 1

Views

Author

Denis Ivanov, Jun 06 2023

Keywords

Comments

a(n) = n iff n=1 or n is prime.
For composite n, A363627(n) < n < a(n) and where both bounds are products of divisors of n and as tight as possible.

Examples

			n = 4; divisors: [1,2,4]; subsets: [[], [1], [2], [4], [1, 2], [1, 4], [2, 4], [1, 2, 4]]; products: [1, 1, 2, 4, 2, 4, 8, 8]; minimal product that greater than 4 is 8, so a(4) = 8.
n = 5; divisors: [1,5]; subsets: [[], [1], [5], [1, 5]]; products: [1, 1, 5, 5]; no products greater than 5, so a(5) = 5.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ@n || n == 1, n,
      First@Select[Union[Times @@@ Subsets[Divisors@n]], # > n &]];
  • PARI
    a(n) = my(d=divisors(n), nb = #d, m=oo); forsubset(nb, s, my(p=vecprod(vector(#s, k, d[s[k]]))); if (p>n, m=min(m, p))); if (mMichel Marcus, Jun 17 2023