OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (1,4,-4,-6,6,4,-4,-1,1).
FORMULA
Empirical g.f.: x^2*(x^5-6*x^4+2*x^3-16*x^2-3*x-2) / ((x-1)^5*(x+1)^4). - Colin Barker, Sep 03 2013
Conjectures from Colin Barker, Mar 20 2015: (Start)
a(n) = (n^4+4*n^3-2*n^2-4*n)/16 for n even.
a(n) = (n^4-1)/16 for n odd. (End)
The above conjectures are true. - Sela Fried, Dec 08 2024
E.g.f.: (x*(1 + 17*x + 6*x^2 + x^3)*cosh(x) - (1 + x - 7*x^2 - 10*x^3 - x^4)*sinh(x))/16. - Stefano Spezia, Dec 09 2024
EXAMPLE
{1,2,3} -> 1*2-1*3+2*3 = 5.
{1,2,3,4} -> 1*2-1*3+1*4+2*3+2*4+3*4 = 29.
{1,2,3,4,5} -> 1*2-1*3+1*4-1*5+2*3+2*4+2*5+3*4-3*5+4*5 = 39.
MAPLE
P:=proc(n) local a, i, j, k, w; for i from 1 by 1 to n do a:=0; for j from 1 by 1 to i do w:=j; k:=i; while k>w do a:=a+w*k*(-1)^(w*k); k:=k-1; od; od; print(a); od; end: P(100);
MATHEMATICA
epop[n_]:=Module[{f=Times@@@Subsets[n, {2}]}, Total[Select[f, EvenQ]]-Total[ Select[ f, OddQ]]]; Table[epop[Range[n]], {n, 40}] (* Harvey P. Dale, Sep 17 2017 *)
PROG
(PARI) a(n) = {s = 0; for (i=1, n, for (j=i+1, n, p = i*j; if (p % 2, s -= p, s += p); ); ); s; } \\ Michel Marcus, Mar 20 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jan 31 2008
STATUS
approved