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.

A363627 a(n) = greatest product < n of some subset of the divisors of n, or if n is in A008578 then a(n) = n.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 4, 3, 5, 11, 8, 13, 7, 5, 8, 17, 12, 19, 10, 7, 11, 23, 18, 5, 13, 9, 14, 29, 20, 31, 16, 11, 17, 7, 27, 37, 19, 13, 32, 41, 36, 43, 22, 27, 23, 47, 36, 7, 25, 17, 26, 53, 36, 11, 32
Offset: 1

Views

Author

Denis Ivanov, Jun 12 2023

Keywords

Comments

a(n) = n <=> n in A008578.
For composite n, a(n) < n < A363501(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]; the maximal product that is lesser than 4 is 2, so a(4) = 2.
		

Crossrefs

Programs

  • Mathematica
    If[PrimeQ@n || n == 1, n,
      Last@Select[Union[Times @@@ Subsets[Divisors@n]], # < n &]];
  • PARI
    a(n) = my(d=divisors(n), nb = #d, m=1); forsubset(nb, s, my(p=vecprod(vector(#s, k, d[s[k]]))); if (p1, m, n); \\ Michel Marcus, Jun 17 2023