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.
FORMULA
a(n) = A000142(n) for n = 1 and n > 2; a(2) = 3.
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
KEYWORD
nonn,easy
AUTHOR
Rick L. Shepherd, Oct 10 2020
STATUS
approved