OFFSET
1,2
LINKS
FORMULA
For n>1, a(n) = 3^n/2 for n even and a(n) = 4*3^(n-3)/2 for n odd.
For n>3, a(n) = 3*a(n-2). G.f.: x*(1+3*x+x^2)/(1-3*x^2). [Colin Barker, Apr 18 2012]
Closed form: a(1)=1, then a(n) = 1/6*(7-(-1)^(n-2))*3^(1/4*(-1)^(n-2))*3^(1/2*(n-2))*27^(1/4) = 3^((2*n+(-1)^n-5)/4)*(7-(-1)^n)/2. [Paolo P. Lava, Apr 20 2012]
EXAMPLE
For n=21 the partition (2,2,2,2,2,2,2,2,2,3) gives sigma(2)^9*sigma(3)=3^9*4=78732 that is the maximum value that can be reached.
MAPLE
MATHEMATICA
LinearRecurrence[{0, 3}, {1, 3, 4}, 40] (* Harvey P. Dale, Jun 06 2015 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Apr 13 2012
STATUS
approved