cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 14 results. Next

A056450 a(n) = (3*2^n - (-2)^n)/2.

Original entry on oeis.org

1, 4, 4, 16, 16, 64, 64, 256, 256, 1024, 1024, 4096, 4096, 16384, 16384, 65536, 65536, 262144, 262144, 1048576, 1048576, 4194304, 4194304, 16777216, 16777216, 67108864, 67108864, 268435456, 268435456, 1073741824, 1073741824, 4294967296
Offset: 0

Views

Author

Keywords

Comments

Number of palindromes of length n using a maximum of four different symbols.
Number of achiral rows of n colors using up to four colors. - Robert A. Russell, Nov 09 2018
Interleaving of A000302 and 4*A000302.
Unsigned version of A141125.
Binomial transform is A164907. Second binomial transform is A164908. Third binomial transform is A057651. Fourth binomial transform is A016129.

Examples

			At length n=1 there are a(1)=4 palindromes, A, B, C, D.
At length n=2, there are a(2)=4 palindromes, AA, BB, CC, DD.
At length n=3, there are a(3)=16 palindromes, AAA, BBB, CCC, DDD, ABA, BAB, ... , CDC, DCD.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column k=4 of A321391.
Cf. A016116.
Essentially the same as A213173.
Cf. A000302 (oriented), A032121 (unoriented), A032087(n>1) (chiral).

Programs

  • Magma
    [ (3*2^n-(-2)^n)/2: n in [0..31] ];
    
  • Magma
    [4^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
    
  • Mathematica
    Table[4^Ceiling[n/2], {n,0,40}] (* or *)
    CoefficientList[Series[(1 + 4 x)/((1 + 2 x) (1 - 2 x)), {x, 0, 31}], x] (* or *)
    LinearRecurrence[{0, 4}, {1, 4}, 40] (* Robert A. Russell, Nov 07 2018 *)
  • PARI
    a(n)=4^((n+1)\2) \\ Charles R Greathouse IV, Apr 08 2012
    
  • PARI
    a(n)=(3*2^n-(-2)^n)/2 \\ Charles R Greathouse IV, Oct 03 2016

Formula

a(n) = 4^floor((n+1)/2).
a(n) = 4*a(n-2) for n > 1; a(0) = 1, a(1) = 4.
G.f.: (1+4*x) / (1-4*x^2). - R. J. Mathar, Jan 19 2011 [Adapted to offset 0 by Robert A. Russell, Nov 07 2018]
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = 4*abs(A164111(n-1)). - R. J. Mathar, Jan 19 2011
a(n) = C(4,0)*A000007(n) + C(4,1)*A057427(n) + C(4,2)*A056453(n) + C(4,3)*A056454(n) + C(4,4)*A056455(n). - Robert A. Russell, Nov 08 2018

Extensions

a(0)=1 prepended by Robert A. Russell, Nov 07 2018
Edited by N. J. A. Sloane, Sep 29 2019

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

Original entry on oeis.org

1, 2, 6, 12, 28, 56, 120, 240, 496, 992, 2016, 4032, 8128, 16256, 32640, 65280, 130816, 261632, 523776, 1047552, 2096128, 4192256, 8386560, 16773120, 33550336, 67100672, 134209536, 268419072, 536854528, 1073709056, 2147450880, 4294901760, 8589869056
Offset: 0

Views

Author

N. J. A. Sloane, Sep 24 2006

Keywords

Comments

Equals row sums of triangle A156665. - Gary W. Adamson, Feb 12 2009
a(n) is the number of subsets of {1,2,...,n+1} that contain at least one odd integer. - Geoffrey Critzer, Mar 03 2009
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
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

Examples

			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
		

Crossrefs

Essentially the same as A032085.

Programs

  • GAP
    List([0..35],n->2^(n+1)-2^(QuoInt(n+1,2))); # Muniru A Asiru, Sep 27 2018
  • Maple
    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
  • Mathematica
    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 *)
    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 *)
    Table[(StirlingS2[n,2] - StirlingS2[Floor[n/2]+1,2])/2, {n,3,30}] (* Robert A. Russell, Jan 29 2018 *)
    a[ n_] := 2^(n + 1) - 2^Quotient[n + 1, 2]; (* Michael Somos, Jul 01 2018 *)
  • PARI
    {a(n) = 2^(n+1) - 2^((n+1)\2)}; /* Michael Somos, Jul 01 2018 */
    

Formula

From Alexander Adamchuk, Sep 25 2006: (Start)
a(2k) = A006516(k+1) = 2^k*(2^(k+1) - 1) = A020522(k+1) /2.
a(2k+1) = 2*A006516(k+1) = 2^(k+1)*(2^(k+1) - 1) = A020522(k+1). (End)
a(n) = 2^(n+1) - 2^(floor((n+1)/2)). - Geoffrey Critzer, Mar 03 2009
a(n) = 2*(a(n-1) bitwiseOR a(n-2)), a(0)=1, a(1)=2. - Pierre Charland, Dec 12 2010
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
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
a(n) = (A000079(n+2) - A060546(n+2))/ 2. - Robert A. Russell, Jun 19 2018
a(n) = -a(-3-n) * 2^(n+2 + floor((n+1)/2)) for all n in Z. - Michael Somos, Jul 01 2018
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

A056449 a(n) = 3^floor((n+1)/2).

Original entry on oeis.org

1, 3, 3, 9, 9, 27, 27, 81, 81, 243, 243, 729, 729, 2187, 2187, 6561, 6561, 19683, 19683, 59049, 59049, 177147, 177147, 531441, 531441, 1594323, 1594323, 4782969, 4782969, 14348907, 14348907, 43046721, 43046721, 129140163, 129140163, 387420489, 387420489, 1162261467
Offset: 0

Views

Author

Keywords

Comments

One followed by powers of 3 with positive exponent, repeated. - Omar E. Pol, Jul 27 2009
Number of achiral rows of n colors using up to three colors. E.g., for a(3) = 9, the rows are AAA, ABA, ACA, BAB, BBB, BCB, CAC, CBC, and CCC. - Robert A. Russell, Nov 07 2018

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column k=3 of A321391.
Essentially the same as A108411 and A162436.
Cf. A000244 (oriented), A032120 (unoriented), A032086(n>1) (chiral).

Programs

  • Magma
    [3^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
    
  • Mathematica
    Riffle[3^Range[0, 20], 3^Range[20]] (* Harvey P. Dale, Jan 21 2015 *)
    Table[3^Ceiling[n/2], {n,0,40}] (* or *)
    LinearRecurrence[{0, 3}, {1, 3}, 40] (* Robert A. Russell, Nov 07 2018 *)
  • PARI
    a(n)=3^floor((n+1)/2); \\ Joerg Arndt, Apr 23 2013
    
  • Python
    def A056449(n): return 3**(n+1>>1) # Chai Wah Wu, Oct 28 2024

Formula

G.f.: (1 + 3*x) / (1 - 3*x^2). - R. J. Mathar, Jul 06 2011 [Adapted to offset 0 by Robert A. Russell, Nov 07 2018]
a(n) = k^ceiling(n/2), where k = 3 is the number of possible colors. - Robert A. Russell, Nov 07 2018
a(n) = C(3,0)*A000007(n) + C(3,1)*A057427(n) + C(3,2)*A056453(n) + C(3,3)*A056454(n). - Robert A. Russell, Nov 08 2018
E.g.f.: cosh(sqrt(3)*x) + sqrt(3)*sinh(sqrt(3)*x). - Stefano Spezia, Dec 31 2022

Extensions

Edited by N. J. A. Sloane at the suggestion of Klaus Brockhaus, Jul 03 2009
a(0)=1 prepended by Robert A. Russell, Nov 07 2018

A056451 Number of palindromes using a maximum of five different symbols.

Original entry on oeis.org

1, 5, 5, 25, 25, 125, 125, 625, 625, 3125, 3125, 15625, 15625, 78125, 78125, 390625, 390625, 1953125, 1953125, 9765625, 9765625, 48828125, 48828125, 244140625, 244140625, 1220703125, 1220703125, 6103515625, 6103515625, 30517578125, 30517578125, 152587890625, 152587890625
Offset: 0

Views

Author

Keywords

Comments

Number of achiral rows of n colors using up to five colors. For a(3) = 25, the rows are AAA, ABA, ACA, ADA, AEA, BAB, BBB, BCB, BDB, BEB, CAC, CBC, CCC, CDC, CEC, DAD, DBD, DCD, DDD, DED, EAE, EBE, ECE, EDE, and EEE. - Robert A. Russell, Nov 09 2018

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column k=5 of A321391.
Cf. A000351 (oriented), A032122 (unoriented), A032088(n>1) (chiral).

Programs

  • Magma
    [5^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
    
  • Mathematica
    LinearRecurrence[{0,5},{1,5},30] (* or *) Riffle[5^Range[0, 20], 5^Range[20]] (* Harvey P. Dale, Jul 28 2018 *)
    Table[5^Ceiling[n/2], {n,0,40}] (* Robert A. Russell, Nov 07 2018 *)
  • PARI
    vector(40, n, n--; 5^floor((n+1)/2)) \\ G. C. Greubel, Nov 07 2018

Formula

a(n) = 5^floor((n+1)/2).
a(n) = 5*a(n-2). - Colin Barker, May 06 2012
G.f.: (1+5*x) / (1-5*x^2). - Colin Barker, May 06 2012 [Adapted to offset 0 by Robert A. Russell, Nov 07 2018]
a(n) = C(5,0)*A000007(n) + C(5,1)*A057427(n) + C(5,2)*A056453(n) + C(5,3)*A056454(n) + C(5,4)*A056455(n) + C(5,5)*A056456(n). - Robert A. Russell, Nov 08 2018
E.g.f.: cosh(sqrt(5)*x) + sqrt(5)*sinh(sqrt(5)*x). - Stefano Spezia, Jun 06 2023

Extensions

a(0)=1 prepended by Robert A. Russell, Nov 07 2018

A056452 a(n) = 6^floor((n+1)/2).

Original entry on oeis.org

1, 6, 6, 36, 36, 216, 216, 1296, 1296, 7776, 7776, 46656, 46656, 279936, 279936, 1679616, 1679616, 10077696, 10077696, 60466176, 60466176, 362797056, 362797056, 2176782336, 2176782336, 13060694016, 13060694016, 78364164096
Offset: 0

Views

Author

Keywords

Comments

Number of achiral rows of length n using up to six different colors. For a(3) = 36, the rows are AAA, ABA, ACA, ADA, AEA, AFA, BAB, BBB, BCB, BDB, BEB, BFB, CAC, CBC, CCC, CDC, CEC, CFC, DAD, DBD, DCD, DDD, DED, DFD, EAE, EBE, ECE, EDE, EEE, EFE, FAF, FBF, FCF, FDF, FEF, and FFF. - Robert A. Russell, Nov 08 2018
Also: a(n) is the number of palindromes with n digits using a maximum of six different symbols. - David A. Corneth, Nov 09 2018

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column k=6 of A321391.
Cf. A016116.
Cf. A000400 (oriented), A056308 (unoriented), A320524 (chiral).

Programs

  • Magma
    [6^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
  • Maple
    A056452:=n->6^floor((n+1)/2);
  • Mathematica
    Riffle[6^Range[0, 20], 6^Range[20]] (* Harvey P. Dale, Jun 18 2017 *)
    Table[6^Ceiling[n/2], {n,0,40}] (* or *)
    LinearRecurrence[{0, 6}, {1, 6}, 40] (* Robert A. Russell, Nov 08 2018 *)

Formula

a(n) = 6^floor((n+1)/2).
a(n) = 6*a(n-2). - Colin Barker, May 06 2012
G.f.: (1+6*x) / (1-6*x^2). - Colin Barker, May 06 2012 [Adapted to offset 0 by Robert A. Russell, Nov 08 2018]
a(n) = C(6,0)*A000007(n) + C(6,1)*A057427(n) + C(6,2)*A056453(n) + C(6,3)*A056454(n) + C(6,4)*A056455(n) + C(6,5)*A056456(n) + C(6,6)*A056457(n). - Robert A. Russell, Nov 08 2018

Extensions

a(0)=1 prepended by Robert A. Russell, Nov 08 2018
Name corrected by David A. Corneth, Nov 08 2018

A056309 Number of reversible strings with n beads using exactly two different colors.

Original entry on oeis.org

0, 1, 4, 8, 18, 34, 70, 134, 270, 526, 1054, 2078, 4158, 8254, 16510, 32894, 65790, 131326, 262654, 524798, 1049598, 2098174, 4196350, 8390654, 16781310, 33558526, 67117054, 134225918, 268451838, 536887294, 1073774590, 2147516414, 4295032830, 8590000126
Offset: 1

Views

Author

Keywords

Comments

A string and its reverse are considered to be equivalent.

Examples

			For n=3, the four rows are ABA, BAB, AAB, and ABB, the last two being respectively equivalent to BAA and BBA, with which they form chiral pairs. - _Robert A. Russell_, Sep 25 2018
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Equals (A000918 + A056453) / 2.
a(n) = A000918(n) - A122746(n-2) = A122746(n-2) + A056453(n).

Programs

  • Magma
    [2^(n-1)+2^((n-1) div 2)-2: n in [1..40]]; // Vincenzo Librandi, Sep 29 2018
  • Maple
    seq(2^(n-1) + 2^floor((n-1)/2) - 2, n=1..34); # Peter Luschny, Nov 25 2017
  • Mathematica
    Rest[CoefficientList[Series[x^2(1+x-4x^2)/(1-3x+6x^3-4x^4),{x,0,30}],x]] (* or *) LinearRecurrence[{3,0,-6,4},{0,1,4,8},30] (* Harvey P. Dale, Feb 18 2012 *)
  • PARI
    Vec(x^2*(1+x-4*x^2)/(1-3*x+6*x^3-4*x^4) + O(x^40)) \\ Colin Barker, Nov 24 2017
    
  • PARI
    a(n) = 2^(n-1)+2^((n-1)\2)-2; \\ Altug Alkan, Sep 25 2018
    

Formula

a(n) = A005418(n+1) - 2.
G.f.: x^2*(1 + x - 4*x^2)/(1 - 3*x + 6*x^3 - 4*x^4). - Colin Barker, Feb 03 2012
a(1)=0, a(2)=1, a(3)=4, a(4)=8, a(n) = 3*a(n-1) - 6*a(n-3) + 4*a(n-4). - Harvey P. Dale, Feb 18 2012
From Colin Barker, Nov 24 2017: (Start)
a(n) = 2^(n/2-1) + 2^(n-1) - 2 for n even.
a(n) = 2^((n-1)/2) + 2^(n-1) - 2 for n odd. (End)
a(n) = A000079(n-1) + A056453(n-2). - Peter Luschny, Nov 25 2017
a(n) = k! (S2(n,k) + S2(ceiling(n/2),k)) / 2, where k=2 is the number of colors and S2 is the Stirling subset number. - Robert A. Russell, Sep 25 2018

A208900 Number of bitstrings of length n which (if having two or more runs) the last two runs have different lengths.

Original entry on oeis.org

2, 2, 6, 10, 26, 50, 114, 226, 482, 962, 1986, 3970, 8066, 16130, 32514, 65026, 130562, 261122, 523266, 1046530, 2095106, 4190210, 8384514, 16769026, 33546242, 67092482, 134201346, 268402690, 536838146, 1073676290, 2147418114, 4294836226, 8589803522
Offset: 1

Views

Author

David Nacin, Mar 03 2012

Keywords

Comments

A run is a maximal subsequence of (possibly just one) identical bits.

Examples

			If n=3 the bitstrings where the last runs have different lengths are 111,000,100,011,110,001 so a(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[2 + 2^n - 2^(Floor[n/2] + 1) ,  {n, 1, 40}]
    LinearRecurrence[{3, 0, -6, 4}, {2, 2, 6, 10}, 40]

Formula

a(n) = 2^n + 2 - 2^(floor(n/2)+1).
a(n) = 3*a(n-1) - 6*a(n-3) + 4*a(n-4), a(0) = 2, a(1) = 2, a(2) = 6, a(3) = 10.
G.f.: x*(2 - 4*x + 4*x^3)/((1-x)*(1-2*x^2)*(1-2*x)).
E.g.f.: - 2*cosh(sqrt(2)*x) + 2*exp(x)*(1 + sinh(x)) - sqrt(2)*sinh(sqrt(2)*x). - Stefano Spezia, Jun 06 2023

A208901 Number of bitstrings of length n (with at least two runs) where the last two runs have different lengths.

Original entry on oeis.org

0, 0, 4, 8, 24, 48, 112, 224, 480, 960, 1984, 3968, 8064, 16128, 32512, 65024, 130560, 261120, 523264, 1046528, 2095104, 4190208, 8384512, 16769024, 33546240, 67092480, 134201344, 268402688, 536838144, 1073676288, 2147418112, 4294836224, 8589803520
Offset: 1

Views

Author

David Nacin, Mar 03 2012

Keywords

Comments

A run is a maximal subsequence of (possibly just one) identical bits.

Examples

			If n=3 the bitstrings (with at least two runs) where the last runs have different lengths are 100,011,110,001 so a(3) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[2^n - 2^(Floor[ n/2] + 1) ,  {n, 1, 40}]
    LinearRecurrence[{2, 2, -4}, {0, 0, 4}, 40]

Formula

a(n) = 2^n - 2^(floor(n/2)+1).
a(n) = 2*a(n-1) + 2*a(n-2) - 4*a(n-3), a(0) = 0, a(1) = 0, a(2) = 4.
G.f.: 4*x^2/((1 - 2*x)*(1 - 2*x^2)).
E.g.f.: 2*(cosh(2*x) - cosh(sqrt(2)*x) + sinh(2*x) - sqrt(2)*sinh(sqrt(2)*x)). - Stefano Spezia, Jun 06 2023

A208902 The sum over all bitstrings b of length n of the number of runs in b not immediately followed by a longer run.

Original entry on oeis.org

2, 6, 14, 34, 78, 182, 414, 942, 2110, 4702, 10366, 22718, 49406, 106878, 229886, 492286, 1049598, 2229758, 4720638, 9964542, 20975614, 44046334, 92282878, 192950270, 402669566, 838885374, 1744863230, 3623927806, 7516258302, 15569354750, 32212385790
Offset: 1

Views

Author

David Nacin, Mar 03 2012

Keywords

Comments

A run is a maximal subsequence of (possibly just one) identical bits.

Examples

			When n=3, 000,111 each have 1 such run, 101,010 each have 3, 100,011 each have 1, 001, 110 each have 2, summing these gives 2+6+2+4=14 so a(3) = 14.
		

Crossrefs

Programs

  • Mathematica
    Table[2^n*(2 + (n - 1)/2 - (1/2)^(n - 1) - 2*(1 - (1/2)^Floor[n/2]) + (1/2)^(Floor[n/2] + 1) (1 + (-1)^n)), {n, 1, 40}]
    LinearRecurrence[{5, -6, -6, 16, -8}, {2, 6, 14, 34, 78}, 40]

Formula

a(n) = 2^n * (2 + (n - 1)/2 - (1/2)^(n - 1) - 2 (1 - (1/2)^floor(n/2)) + (1/2)^(floor(n/2) + 1) (1 + (-1)^n)).
a(n) = A208903(n) + 2.
a(n) = 5*a(n-1) - 6*a(n-2) - 6*a(n-3) + 16*a(n-4) - 8*a(n-5), a(1) = 2, a(2) = 6, a(3) = 14, a(4) = 34, a(5) = 78.
G.f.: (2 - 4*x - 4*x^2 + 12*x^3 - 4*x^4)/(1 - 5*x + 6*x^2 + 6*x^3 - 16*x^4 + 8*x^5).

A208903 The sum over all bitstrings b of length n with at least two runs of the number of runs in b not immediately followed by a longer run.

Original entry on oeis.org

0, 4, 12, 32, 76, 180, 412, 940, 2108, 4700, 10364, 22716, 49404, 106876, 229884, 492284, 1049596, 2229756, 4720636, 9964540, 20975612, 44046332, 92282876, 192950268, 402669564, 838885372, 1744863228, 3623927804, 7516258300, 15569354748, 32212385788
Offset: 1

Views

Author

David Nacin, Mar 03 2012

Keywords

Comments

A run is a maximal subsequence of (possibly just one) identical bits.

Examples

			n=3: 101, 010 each have 3; 100, 011 each have 1; 001, 110 each have 2. (000, 111 do not have at least two runs so they do not contribute.) Summing these gives 6+2+4 = 12 so a(3) = 12.
		

Crossrefs

Programs

  • Mathematica
    Table[2^n*(2 + (n-1)/2 - (1/2)^(n-1) - 2*(1 - (1/2)^Floor[n/2]) + (1/2)^(Floor[n/2] + 1) (1 + (-1)^n)) - 2, {n, 1, 40}]
    LinearRecurrence[{5, -6, -6, 16, -8}, {0, 4, 12, 32, 76}, 40]

Formula

a(n) = 2^n * (2 + (n - 1)/2 - (1/2)^(n - 1) - 2 (1 - (1/2)^floor(n/2)) + (1/2)^(floor(n/2) + 1) (1 + (-1)^n)) - 2.
a(n) = A208902(n) - 2.
a(n) = 5*a(n-1) - 6*a(n-2) - 6*a(n-3) + 16*a(n-4) - 8*a(n-5), a(1) = 0, a(2) = 4, a(3) = 12, a(4) = 32, a(5) = 76.
G.f.: (4*x - 8*x^2 - 4*x^3 + 12*x^4)/(1 - 5*x + 6*x^2 + 6*x^3 - 16*x^4 +
8*x^5).
Showing 1-10 of 14 results. Next