login
G.f.: 1/((1-2*x)*(1-2*x^2)).
21

%I #79 Oct 18 2022 14:53:23

%S 1,2,6,12,28,56,120,240,496,992,2016,4032,8128,16256,32640,65280,

%T 130816,261632,523776,1047552,2096128,4192256,8386560,16773120,

%U 33550336,67100672,134209536,268419072,536854528,1073709056,2147450880,4294901760,8589869056

%N G.f.: 1/((1-2*x)*(1-2*x^2)).

%C Equals row sums of triangle A156665. - _Gary W. Adamson_, Feb 12 2009

%C a(n) is the number of subsets of {1,2,...,n+1} that contain at least one odd integer. - _Geoffrey Critzer_, Mar 03 2009

%C a(n-3) is the number of chiral pairs of color patterns of length n using two colors. Two color patterns are equivalent if the colors are permuted. For example, a string of five colors using exactly two different colors has six chiral pairs: AAAAB-ABBBB, AAABA-ABAAA, AAABB-AABBB, AABAB-ABABB, AABBA-ABBAA, and ABAAB-ABBAB. The number of color patterns of length n using exactly k colors when chiral pairs are counted twice is the Stirling subset number S2(n,k). The number of achiral color patterns of length n using exactly 2 colors is S2(floor(n/2)+1,2). The value of a(n-3) is half the difference of these two. - _Robert A. Russell_, Feb 01 2018

%C a(n-2) is the number of chiral pairs for a row of n colors with exactly 2 different colors. If the reverse of a sequence is different, the combination of the two is a chiral pair. For a row of 4 colors using exactly 2 different colors, the chiral pairs are AAAB-BAAA, AABA-ABAA, AABB-BBAA, ABAB-BABA, ABBB-BBBA, and BABB-BBAB. Thus a(4-2) = a(2) = 6. - _Robert A. Russell_, Jun 10 2018

%H Harvey P. Dale, <a href="/A122746/b122746.txt">Table of n, a(n) for n = 0..1000</a>

%H S. J. Cyvin et al., <a href="http://pubs.acs.org/doi/abs/10.1021/ci00013a027">Theory of polypentagons</a>, J. Chem. Inf. Comput. Sci., 33 (1993), 466-474.

%H E. Filiol and C. Fontaine, <a href="https://doi.org/10.1007/BFb0054147">Highly nonlinear balanced Boolean functions with a good correlation-immunity</a>, Lect. Not. Comp. Sci 1403 (1998), 475-488, NL(F_n).

%H Juan B. Gil and Jessica A. Tomasko, <a href="https://arxiv.org/abs/2112.03338">Restricted Grassmannian permutations</a>, arXiv:2112.03338 [math.CO], 2021.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,2,-4).

%F From _Alexander Adamchuk_, Sep 25 2006: (Start)

%F a(2k) = A006516(k+1) = 2^k*(2^(k+1) - 1) = A020522(k+1) /2.

%F a(2k+1) = 2*A006516(k+1) = 2^(k+1)*(2^(k+1) - 1) = A020522(k+1). (End)

%F a(n) = 2^(n+1) - 2^(floor((n+1)/2)). - _Geoffrey Critzer_, Mar 03 2009

%F a(n) = 2*(a(n-1) bitwiseOR a(n-2)), a(0)=1, a(1)=2. - _Pierre Charland_, Dec 12 2010

%F G.f.: (1+x*Q(0))/(1-x)^2, where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - _Sergei N. Gladkovskii_, May 23 2013

%F a(0)=1, a(1)=2, a(2)=6, a(n) = 2*a(n-1) + 2*a(n-2) - 4*a(n-3). - _Harvey P. Dale_, Jun 25 2013

%F a(n) = (A000079(n+2) - A060546(n+2))/ 2. - _Robert A. Russell_, Jun 19 2018

%F a(n) = -a(-3-n) * 2^(n+2 + floor((n+1)/2)) for all n in Z. - _Michael Somos_, Jul 01 2018

%F a(n) = (A000918(n+2) - A056453(n+2)) / 2 = A000918(n+2) - A056309(n+2) = A056309(n+2) - A056453(n+2). - _Robert A. Russell_, Sep 26 2018

%e G.f. = 1 + 2*x + 6*x^2 + 12*x^3 + 28*x^4 + 56*x^5 + 120*x^6 + 240*x^7 + 496*x^8 + ... - _Michael Somos_, Jul 01 2018

%p seq(coeff(series(((1-2*x)*(1-2*x^2))^(-1),x,n+1), x, n), n = 0..35); # _Muniru A Asiru_, Sep 27 2018

%t RecurrenceTable[{a[n] == 2 (BitOr[a[n - 1], a[n - 2]]), a[0] == 1, a[1] == 2}, a, {n, 0, 32}] (* _Geoffrey Critzer_, Jan 09 2011 *)

%t CoefficientList[Series[1/((1-2x)(1-2x^2)),{x,0,40}],x] (* or *) LinearRecurrence[{2,2,-4},{1,2,6},40] (* _Harvey P. Dale_, Jun 25 2013 *)

%t Table[(StirlingS2[n,2] - StirlingS2[Floor[n/2]+1,2])/2, {n,3,30}] (* _Robert A. Russell_, Jan 29 2018 *)

%t a[ n_] := 2^(n + 1) - 2^Quotient[n + 1, 2]; (* _Michael Somos_, Jul 01 2018 *)

%o (PARI) {a(n) = 2^(n+1) - 2^((n+1)\2)}; /* _Michael Somos_, Jul 01 2018 */

%o (GAP) List([0..35],n->2^(n+1)-2^(QuoInt(n+1,2))); # _Muniru A Asiru_, Sep 27 2018

%Y Essentially the same as A032085.

%Y Cf. A000079, A060546.

%Y Cf. A006516, A020522, A156665.

%Y Cf. A000918, A056309, A056453.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_, Sep 24 2006