OFFSET
0,3
LINKS
FORMULA
From Chai Wah Wu, Nov 14 2023: (Start)
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3) for n > 3.
G.f.: 2*x^2*(1 - x)/((2*x - 1)*(3*x^2 - 1)). (End)
EXAMPLE
The a(0) = 0 through a(5) = 14 subsets:
. . {1} {1,2} {2} {1,4}
{1,2} {1,2,3} {1,2} {2,3}
{1,3} {1,2,3}
{2,3} {1,2,4}
{2,4} {1,3,4}
{1,2,3} {1,4,5}
{1,2,4} {2,3,4}
{1,3,4} {2,3,5}
{2,3,4} {1,2,3,4}
{1,2,3,4} {1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
MATHEMATICA
Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Tuples[#, 2], n]&]], {n, 0, 10}]
PROG
(Python)
def A366131(n): return (1<<n)-(3**(n-1>>1)<<1) if n else 0 # Chai Wah Wu, Nov 14 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Oct 07 2023
STATUS
approved