OFFSET
0,4
COMMENTS
a(n) mod 10 is zero followed by a sequence with period length 8: 0, 1, 2, 7, 4, 7, 4, 5 (repeat).
a(n) is the number of length n+1 binary words with some prefix w such that w contains three more 1's than 0's and no prefix of w contains three more 0's than 1's. - Geoffrey Critzer, Dec 13 2013
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} with two distinct elements summing to n + 1. For example, the a(2) = 1 through a(5) = 14 subsets are:
{1,2} {1,3} {1,4} {1,5}
{1,2,3} {2,3} {2,4}
{1,2,3} {1,2,4}
{1,2,4} {1,2,5}
{1,3,4} {1,3,5}
{2,3,4} {1,4,5}
{1,2,3,4} {2,3,4}
{2,4,5}
{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}
The complement is counted by A038754.
The version for all subsets (not just pairs) is A366130.
(End)
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,3,-6).
FORMULA
a(n+1)-2*a(n) = 0 if n even, = A000244((1+n)/2) if n odd.
G.f.: x^2/((2*x-1)*(3*x^2-1)). a(n) = 2^n - A038754(n). - R. J. Mathar, Nov 12 2009
G.f.: x^2/(1-2*x-3*x^2+6*x^3). - Philippe Deléham, Nov 11 2009
MATHEMATICA
LinearRecurrence[{2, 3, -6}, {0, 0, 1}, 40] (* Harvey P. Dale, Sep 17 2013 *)
CoefficientList[Series[x^2/((2 x - 1) (3 x^2 - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 17 2013 *)
Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Subsets[#, {2}], n+1]&]], {n, 0, 10}] (* Gus Wiseman, Oct 06 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Nov 11 2009
EXTENSIONS
Edited and extended by R. J. Mathar, Nov 12 2009
STATUS
approved