OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,2,-2,0,0,-1,1).
FORMULA
a(n) = Sum_{i=1..floor((n-1)/2)} (n-i) * ((n-i+1) mod 2).
G.f.: 2*x^3*(1-x+2*x^2+x^4)/((1-x)*(1-x^4)^2). - Robert Israel, Dec 20 2017
From Wesley Ivan Hurt, Jan 15 2024: (Start)
a(n) = a(n-1) + 2*a(n-4) - 2*a(n-5) - a(n-8) + a(n-9).
a(n) = (1-10*n+6*n^2+(3-10*n)*(-1)^n-2*(2*n+1+(-1)^n)*(-1)^((2*n-1+(-1)^n)/4))/32. (End)
EXAMPLE
a(12) = 18; the partitions of 12 into two distinct parts are (11,1), (10,2), (9,3), (8,4) and (7,5). The sum of the even numbers among the larger parts gives 10 + 8 = 18.
MAPLE
f:= gfun:-rectoproc({a(n-9)-a(n-8)-2*a(n-5)+2*a(n-4)+a(n-1)-a(n)=0, seq(a(n)=[0, 0, 2, 0, 4, 4, 10, 6, 14][n], n=1..9)}, a(n), remember):
map(f, [$1..100]); # Robert Israel, Dec 21 2017
MATHEMATICA
Table[Sum[(n - i) Mod[n - i + 1, 2], {i, Floor[(n - 1)/2]}], {n, 80}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 20 2017
STATUS
approved