The OEIS is supported by the many generous donors to the OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A338112 Least number that is both the sum and product of n distinct positive integers. 1
 1, 3, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000, 51090942171709440000, 1124000727777607680000 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Each a(n) = n! except that a(2) = 1+2 = 3. For n > 0, only each integer >= A000217(n) is the sum of n distinct positive integers. For the integers that are products of these types, see below. LINKS Table of n, a(n) for n=1..22. FORMULA a(n) = A000142(n) for n = 1 and n > 2; a(2) = 3. a(n) = max(A000142(n), A000217(n)). E.g.f.: x*(2 + x - x^2)/(2*(1 - x)). - Stefano Spezia, Oct 11 2020 EXAMPLE a(1) = 1 because we define sums and products as sum(m) := prod(m) := m for all integers m in this case where these normally-binary operations only have one operand. a(3) = 6 because 6 = 1+2+3 = 1*2*3 (with all the distinct positive integers the same in the sum and the product only for this term and a(1)). a(5) = 120 because 120 = 1+2+3+4+110 (= ... = 22+23+24+25+26) = 1*2*3*4*5. MATHEMATICA Array[If[# <= 2, (#^2 - #)/2 &[# + 1], #!] &, 22] (* Michael De Vlieger, Oct 15 2020 *) With[{nn=30}, Rest[CoefficientList[Series[x (2+x-x^2)/(2(1-x)), {x, 0, nn}], x] Range[0, nn]!]] (* Harvey P. Dale, Aug 10 2021 *) PROG (PARI) a(n) = if(n<1, , if(n==2, 3, n!)) CROSSREFS Cf. A000142, A000217. Cf. Products of k distinct positive integers: A000027 (k=1), A020725 (k=2), A080257 (k=3), A122181 (k=4). Sequence in context: A295761 A262349 A109155 * A294381 A081072 A000717 Adjacent sequences: A338109 A338110 A338111 * A338113 A338114 A338115 KEYWORD nonn,easy AUTHOR Rick L. Shepherd, Oct 10 2020 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 1 08:56 EST 2023. Contains 367469 sequences. (Running on oeis4.)