login
A363627
a(n) = greatest product < n of some subset of the divisors of n, or if n is in A008578 then a(n) = n.
1
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,2
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.
EXAMPLE
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.
MATHEMATICA
If[PrimeQ@n || n == 1, n,
Last@Select[Union[Times @@@ Subsets[Divisors@n]], # < n &]];
PROG
(PARI) a(n) = my(d=divisors(n), nb = #d, m=1); forsubset(nb, s, my(p=vecprod(vector(#s, k, d[s[k]]))); if (p<n, m=max(m, p))); if (m>1, m, n); \\ Michel Marcus, Jun 17 2023
CROSSREFS
Sequence in context: A346701 A347044 A117818 * A073890 A079311 A364391
KEYWORD
nonn
AUTHOR
Denis Ivanov, Jun 12 2023
STATUS
approved