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 19 results. Next

A011782 Coefficients of expansion of (1-x)/(1-2*x) in powers of x.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592
Offset: 0

Views

Author

Lee D. Killough (killough(AT)wagner.convex.com)

Keywords

Comments

Apart from initial term, same as A000079 (powers of 2).
Number of compositions (ordered partitions) of n. - Toby Bartels, Aug 27 2003
Number of ways of putting n unlabeled items into (any number of) labeled boxes where every box contains at least one item. Also "unimodal permutations of n items", i.e., those which rise then fall. (E.g., for three items: ABC, ACB, BCA and CBA are unimodal.) - Henry Bottomley, Jan 17 2001
Number of permutations in S_n avoiding the patterns 213 and 312. - Tuwani Albert Tshifhumulo, Apr 20 2001. More generally (see Simion and Schmidt), the number of permutations in S_n avoiding (i) the 123 and 132 patterns; (ii) the 123 and 213 patterns; (iii) the 132 and 213 patterns; (iv) the 132 and 231 patterns; (v) the 132 and 312 patterns; (vi) the 213 and 231 patterns; (vii) the 213 and 312 patterns; (viii) the 231 and 312 patterns; (ix) the 231 and 321 patterns; (x) the 312 and 321 patterns.
a(n+2) is the number of distinct Boolean functions of n variables under action of symmetric group.
Number of unlabeled (1+2)-free posets. - Detlef Pauly, May 25 2003
Image of the central binomial coefficients A000984 under the Riordan array ((1-x), x*(1-x)). - Paul Barry, Mar 18 2005
Binomial transform of (1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...); inverse binomial transform of A007051. - Philippe Deléham, Jul 04 2005
Also, number of rationals in [0, 1) whose binary expansions terminate after n bits. - Brad Chalfan, May 29 2006
Equals row sums of triangle A144157. - Gary W. Adamson, Sep 12 2008
Prepend A089067 with a 1, getting (1, 1, 3, 5, 13, 23, 51, ...) as polcoeff A(x); then (1, 1, 2, 4, 8, 16, ...) = A(x)/A(x^2). - Gary W. Adamson, Feb 18 2010
An elephant sequence, see A175655. For the central square four A[5] vectors, with decimal values 2, 8, 32 and 128, lead to this sequence. For the corner squares these vectors lead to the companion sequence A094373. - Johannes W. Meijer, Aug 15 2010
From Paul Curtz, Jul 20 2011: (Start)
Array T(m,n) = 2*T(m,n-1) + T(m-1,n):
1, 1, 2, 4, 8, 16, ... = a(n)
1, 3, 8, 20, 48, 112, ... = A001792,
1, 5, 18, 56, 160, 432, ... = A001793,
1, 7, 32, 120, 400, 1232, ... = A001794,
1, 9, 50, 220, 840, 2912, ... = A006974, followed with A006975, A006976, gives nonzero coefficients of Chebyshev polynomials of first kind A039991 =
1,
1, 0,
2, 0, -1,
4, 0, -3, 0,
8, 0, -8, 0, 1.
T(m,n) third vertical: 2*n^2, n positive (A001105).
Fourth vertical appears in Janet table even rows, last vertical (A168342 array, A138509, rank 3, 13, = A166911)). (End)
A131577(n) and differences are:
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16, = a(n),
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16.
Number of 2-color necklaces of length 2n equal to their complemented reversal. For length 2n+1, the number is 0. - David W. Wilson, Jan 01 2012
Edges and also central terms of triangle A198069: a(0) = A198069(0,0) and for n > 0: a(n) = A198069(n,0) = A198069(n,2^n) = A198069(n,2^(n-1)). - Reinhard Zumkeller, May 26 2013
These could be called the composition numbers (see the second comment) since the equivalent sequence for partitions is A000041, the partition numbers. - Omar E. Pol, Aug 28 2013
Number of self conjugate integer partitions with exactly n parts for n>=1. - David Christopher, Aug 18 2014
The sequence is the INVERT transform of (1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...). - Gary W. Adamson, Jul 16 2015
Number of threshold graphs on n nodes [Hougardy]. - Falk Hüffner, Dec 03 2015
Number of ternary words of length n in which binary subwords appear in the form 10...0. - Milan Janjic, Jan 25 2017
a(n) is the number of words of length n over an alphabet of two letters, of which one letter appears an even number of times (the empty word of length 0 is included). See the analogous odd number case in A131577, and the Balakrishnan reference in A006516 (the 4-letter odd case), pp. 68-69, problems 2.66, 2.67 and 2.68. - Wolfdieter Lang, Jul 17 2017
Number of D-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are D-equivalent iff the positions of pattern D are identical in these paths. - Sergey Kirgizov, Apr 08 2018
Number of color patterns (set partitions) for an oriented row of length n using two or fewer colors (subsets). Two color patterns are equivalent if we permute the colors. For a(4)=8, the 4 achiral patterns are AAAA, AABB, ABAB, and ABBA; the 4 chiral patterns are the 2 pairs AAAB-ABBB and AABA-ABAA. - Robert A. Russell, Oct 30 2018
The determinant of the symmetric n X n matrix M defined by M(i,j) = (-1)^max(i,j) for 1 <= i,j <= n is equal to a(n) * (-1)^(n*(n+1)/2). - Bernard Schott, Dec 29 2018
For n>=1, a(n) is the number of permutations of length n whose cyclic representations can be written in such a way that when the cycle parentheses are removed what remains is 1 through n in natural order. For example, a(4)=8 since there are exactly 8 permutations of this form, namely, (1 2 3 4), (1)(2 3 4), (1 2)(3 4), (1 2 3)(4), (1)(2)(3 4), (1)(2 3)(4), (1 2)(3)(4), and (1)(2)(3)(4). Our result follows readily by conditioning on k, the number of parentheses pairs of the form ")(" in the cyclic representation. Since there are C(n-1,k) ways to insert these in the cyclic representation and since k runs from 0 to n-1, we obtain a(n) = Sum_{k=0..n-1} C(n-1,k) = 2^(n-1). - Dennis P. Walsh, May 23 2020
Maximum number of preimages that a permutation of length n + 1 can have under the consecutive-231-avoiding stack-sorting map. - Colin Defant, Aug 28 2020
a(n) is the number of occurrences of the empty set {} in the von Neumann ordinals from 0 up to n. Each ordinal k is defined as the set of all smaller ordinals: 0 = {}, 1 = {0}, 2 = {0,1}, etc. Since {} is the foundational element of all ordinals, the total number of times it appears grows as powers of 2. - Kyle Wyonch, Mar 30 2025

Examples

			G.f. = 1 + x + 2*x^2 + 4*x^3 + 8*x^4 + 16*x^5 + 32*x^6 + 64*x^7 + 128*x^8 + ...
    ( -1   1  -1)
det (  1   1   1)  = 4
    ( -1  -1  -1)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education Journal, Vol. 31, No. 1, pp. 24-28, Winter 1997.
  • S. Kitaev, Patterns in Permutations and Words, Springer-Verlag, 2011. see p. 399 Table A.7
  • Xavier Merlin, Methodix Algèbre, Ellipses, 1995, p. 153.

Crossrefs

Sequences with g.f.'s of the form ((1-x)/(1-2*x))^k: this sequence (k=1), A045623 (k=2), A058396 (k=3), A062109 (k=4), A169792 (k=5), A169793 (k=6), A169794 (k=7), A169795 (k=8), A169796 (k=9), A169797 (k=10).
Cf. A005418 (unoriented), A122746(n-3) (chiral), A016116 (achiral).
Row sums of triangle A100257.
A row of A160232.
Row 2 of A278984.

Programs

  • Haskell
    a011782 n = a011782_list !! n
    a011782_list = 1 : scanl1 (+) a011782_list
    -- Reinhard Zumkeller, Jul 21 2013
    
  • Magma
    [Floor((1+2^n)/2): n in [0..35]]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A011782:= n-> ceil(2^(n-1)): seq(A011782(n), n=0..50); # Wesley Ivan Hurt, Feb 21 2015
    with(PolynomialTools):  A011782:=seq(coeftayl((1-x)/(1-2*x), x = 0, k),k=0..10^2); # Muniru A Asiru, Sep 26 2017
  • Mathematica
    f[s_] := Append[s, Ceiling[Plus @@ s]]; Nest[f, {1}, 32] (* Robert G. Wilson v, Jul 07 2006 *)
    CoefficientList[ Series[(1-x)/(1-2x), {x, 0, 32}], x] (* Robert G. Wilson v, Jul 07 2006 *)
    Table[Sum[StirlingS2[n, k], {k,0,2}], {n, 0, 30}] (* Robert A. Russell, Apr 25 2018 *)
    Join[{1},NestList[2#&,1,40]] (* Harvey P. Dale, Dec 06 2018 *)
  • PARI
    {a(n) = if( n<1, n==0, 2^(n-1))};
    
  • PARI
    Vec((1-x)/(1-2*x) + O(x^30)) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A011782(n): return 1 if n == 0 else 2**(n-1) # Chai Wah Wu, May 11 2022
  • Sage
    [sum(stirling_number2(n,j) for j in (0..2)) for n in (0..35)] # G. C. Greubel, Jun 02 2020
    

Formula

a(0) = 1, a(n) = 2^(n-1).
G.f.: (1 - x) / (1 - 2*x) = 1 / (1 - x / (1 - x)). - Michael Somos, Apr 18 2012
E.g.f.: cosh(z)*exp(z) = (exp(2*z) + 1)/2.
a(0) = 1 and for n>0, a(n) = sum of all previous terms.
a(n) = Sum_{k=0..n} binomial(n, 2*k). - Paul Barry, Feb 25 2003
a(n) = Sum_{k=0..n} binomial(n,k)*(1+(-1)^k)/2. - Paul Barry, May 27 2003
a(n) = floor((1+2^n)/2). - Toby Bartels (toby+sloane(AT)math.ucr.edu), Aug 27 2003
G.f.: Sum_{i>=0} x^i/(1-x)^i. - Jon Perry, Jul 10 2004
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(k+1, n-k)*binomial(2*k, k). - Paul Barry, Mar 18 2005
a(n) = Sum_{k=0..floor(n/2)} A055830(n-k, k). - Philippe Deléham, Oct 22 2006
a(n) = Sum_{k=0..n} A098158(n,k). - Philippe Deléham, Dec 04 2006
G.f.: 1/(1 - (x + x^2 + x^3 + ...)). - Geoffrey Critzer, Aug 30 2008
a(n) = A000079(n) - A131577(n).
a(n) = A173921(A000079(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = Sum_{k=2^n..2^(n+1)-1} A093873(k)/A093875(k), sums of rows of the full tree of Kepler's harmonic fractions. - Reinhard Zumkeller, Oct 17 2010
E.g.f.: (exp(2*x)+1)/2 = (G(0) + 1)/2; G(k) = 1 + 2*x/(2*k+1 - x*(2*k+1)/(x + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Dec 03 2011
A051049(n) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
A008619(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
INVERT transform is A122367. MOBIUS transform is A123707. EULER transform of A059966. PSUM transform is A000079. PSUMSIGN transform is A078008. BINOMIAL transform is A007051. REVERT transform is A105523. A002866(n) = a(n)*n!. - Michael Somos, Apr 18 2012
G.f.: U(0), where U(k) = 1 + x*(k+3) - x*(k+2)/U(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 10 2012
a(n) = A000041(n) + A056823(n). - Omar E. Pol, Aug 31 2013
E.g.f.: E(0), where E(k) = 1 + x/( 2*k+1 - x/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 25 2013
G.f.: 1 + x/(1 + x)*( 1 + 3*x/(1 + 3*x)*( 1 + 5*x/(1 + 5*x)*( 1 + 7*x/(1 + 7*x)*( 1 + ... )))). - Peter Bala, May 27 2017
a(n) = Sum_{k=0..2} stirling2(n, k).
G.f.: Sum_{j=0..k} A248925(k,j)*x^j / Product_{j=1..k} 1-j*x with k=2. - Robert A. Russell, Apr 25 2018
a(n) = A053120(n, n), n >= 0, (main diagonal of triangle of Chebyshev's T polynomials). - Wolfdieter Lang, Nov 26 2019

Extensions

Additional comments from Emeric Deutsch, May 14 2001
Typo corrected by Philippe Deléham, Oct 25 2008

A000975 a(2n) = 2*a(2n-1), a(2n+1) = 2*a(2n)+1 (also a(n) is the n-th number without consecutive equal binary digits).

Original entry on oeis.org

0, 1, 2, 5, 10, 21, 42, 85, 170, 341, 682, 1365, 2730, 5461, 10922, 21845, 43690, 87381, 174762, 349525, 699050, 1398101, 2796202, 5592405, 11184810, 22369621, 44739242, 89478485, 178956970, 357913941, 715827882, 1431655765, 2863311530, 5726623061, 11453246122
Offset: 0

Views

Author

Keywords

Comments

Might be called the "Lichtenberg sequence" after Georg Christoph Lichtenberg, who discussed it in 1769 in connection with the Chinese Rings puzzle (baguenaudier). - Andreas M. Hinz, Feb 15 2017
Number of steps to change from a binary string of n 0's to n 1's using a Gray code. - Jon Stadler (jstadler(AT)coastal.edu)
Popular puzzles such as Spin-Out and The Brain Puzzler are based on the Gray binary system and require a(n) steps to complete for some number n.
Conjecture: {a(n)} also gives all j for which A048702(j) = A000217(j); i.e., if we take the a(n)-th triangular number (a(n)^2 + a(n))/2 and multiply it by 3, we get a(n)-th even-length binary palindrome A048701(a(n)) concatenated from a(n) and its reverse. E.g., a(4) = 10, which is 1010 in binary; the tenth triangular number is 55, and 55*3 = 165 = 10100101 in binary. - Antti Karttunen, circa 1999. (This has been now proved by Paul K. Stockmeyer in his arXiv:1608.08245 paper.) - Antti Karttunen, Aug 31 2016
Number of ways to tie a tie of n or fewer half turns, excluding mirror images. Also number of walks of length n or less on a triangular lattice with the following restrictions; given l, r and c as the lattice axes. 1. All steps are taken in the positive axis direction. 2. No two consecutive steps are taken on the same axis. 3. All walks begin with l. 4. All walks end with rlc or lrc. - Bill Blewett, Dec 21 2000
a(n) is the minimal number of vertices to be selected in a vertex-cover of the balanced tree B_n. - Sen-peng Eu, Jun 15 2002
A087117(a(n)) = A038374(a(n)) = 1 for n > 1; see also A090050. - Reinhard Zumkeller, Nov 20 2003
Intersection of A003754 and A003714; complement of A107907. - Reinhard Zumkeller, May 28 2005
Equivalently, numbers m whose binary representation is effectively, for some number k, both the lazy Fibonacci and the Zeckendorf representation of k (in which case k = A022290(m)). - Peter Munn, Oct 06 2022
a(n+1) gives row sums of Riordan array (1/(1-x), x(1+2x)). - Paul Barry, Jul 18 2005
Total number of initial 01's in all binary words of length n+1. Example: a(3) = 5 because the binary words of length 4 that start with 01 are (01)00, (01)(01), (01)10 and (01)11 and the total number of initial 01's is 5 (shown between parentheses). a(n) = Sum_{k >= 0} k*A119440(n+1, k). - Emeric Deutsch, May 19 2006
In Norway we call the 10-ring puzzle "strikketoy" or "knitwear" (see link). It takes 682 moves to free the two parts. - Hans Isdahl, Jan 07 2008
Equals A002450 and A020988 interlaced. - Zak Seidov, Feb 10 2008
For n > 1, let B_n = the complete binary tree with vertex set V where |V| = 2^n - 1. If VC is a minimum-size vertex cover of B_n, Sen-Peng Eu points out that a(n) = |VC|. It also follows that if IS = V\VC, a(n+1) = |IS|. - K.V.Iyer, Apr 13 2009
Starting with 1 and convolved with [1, 2, 2, 2, ...] = A000295. - Gary W. Adamson, Jun 02 2009
a(n) written in base 2 is sequence A056830(n). - Jaroslav Krizek, Aug 05 2009
This is the sequence A(0, 1; 1, 2; 1) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
From Vladimir Shevelev, Jan 30 2012, Feb 13 2012: (Start)
1) Denote by {n, k} the number of permutations of 1, ..., n with the up-down index k (for definition, see comment in A203827). Then max_k{n, k} = {n, a(n)} = A000111(n).
2) a(n) is the minimal number > a(n-1) with the Hamming distance d_H(a(n-1), a(n)) = n. Thus this sequence is the Hamming analog of triangular numbers 0, 1, 3, 6, 10, ... (End)
From Hieronymus Fischer, Nov 22 2012: (Start)
Represented in binary form each term after the second one contains every previous term as a substring.
The terms a(2) = 2 and a(3) = 5 are the only primes. Proof: For even n we get a(n) = 2*(2^(2*n) - 1)/3, which shows that a(n) is even, too, and obviously a(n) > 2 for all even n > 2. For odd n we have a(n) = (2^(n+1) - 1)/3 = (2^((n+1)/2) - 1) * (2^((n+1)/2) + 1)/3. Evidently, at least one of these factors is divisible by 3, both are greater than 6, provided n > 3. Hence it follows that a(n) is composite for all odd n > 3.
Represented as a binary number, a(n+1) has exactly n prime substrings. Proof: Evidently, a(1) = 1_2 has zero and a(2) = 10_2 has 1 prime substring. Let n > 1. Written in binary, a(n+1) is 101010101...01 (if n + 1 is odd) and is 101010101...10 (if n + 1 is even) with n + 1 digits. Only the 2- and 3-digits substrings 10_2 (=2) and 101_2 (=5) are prime substrings. All the other substrings are nonprime since every substring is a previous term and all terms unequal to 2 and 5 are nonprime. For even n + 1, the number of prime substrings equal to 2 = 10_2 is (n+1)/2, and the number of prime substrings equal to 5 = 101_2 is (n-1)/2, makes a sum of n. For odd n + 1 we get n/2 for both, the number of 2's and 5's prime substrings, in any case, the sum is n. (End)
Number of different 3-colorings for the vertices of all triangulated planar polygons on a base with n+2 vertices if the colors of the two base vertices are fixed. - Patrick Labarque, Feb 09 2013
A090079(a(n)) = a(n) and A090079(m) <> a(n) for m < a(n). - Reinhard Zumkeller, Feb 16 2013
a(n) is the number of length n binary words containing at least one 1 and ending in an even number (possibly zero) of 0's. a(3) = 5 because we have: 001, 011, 100, 101, 111. - Geoffrey Critzer, Dec 15 2013
a(n) is the number of permutations of length n+1 having exactly one descent such that the first element of the permutation is an even number. - Ran Pan, Apr 18 2015
a(n) is the sequence of the last row of the Hadamard matrix H(2^n) obtained via Sylvester's construction: H(2) = [1,1;1,-1], H(2^n) = H(2^(n-1))*H(2), where * is the Kronecker product. - William P. Orrick, Jun 28 2015
Conjectured record values of A264784: a(n) = A264784(A155051(n-1)). - Reinhard Zumkeller, Dec 04 2015. (This is proved by Paul K. Stockmeyer in his arXiv:1608.08245 paper.) - Antti Karttunen, Aug 31 2016
Decimal representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 131", based on the 5-celled von Neumann neighborhood. See A279053 for references and links. - Robert Price, Dec 05 2016
For n > 4, a(n-2) is the second-largest number in row n of A127824. - Dmitry Kamenetsky, Feb 11 2017
Conjecture: a(n+1) is the number of compositions of n with two kinds of parts, n and n', where the order of the 1 and 1' does not matter. For n=2, a(3) = 5 compositions, enumerated as follows: 2; 2'; 1,1; 1',1 = 1',1; 1',1'. - Gregory L. Simay, Sep 02 2017
Conjecture proved by recognizing the appropriate g.f. is x/(1 - x)(1 - x)(1 - 2*x^2 - 2x^3 - ...) = x/(1 - 2*x - x^2 + 2x^3). - Gregory L. Simay, Sep 10 2017
a(n) = 2^(n-1) + 2^(n-3) + 2^(n-5) + ... a(2*k -1) = A002450(k) is the sum of the powers of 4. a(2*k) = 2*A002450(k). - Gregory L. Simay, Sep 27 2017
a(2*n) = n times the string [10] in binary representation, a(2*n+1) = n times the string [10] followed with [1] in binary representation. Example: a(7) = 85 = (1010101) in binary, a(8) = 170 = (10101010) in binary. - Ctibor O. Zizka, Nov 06 2018
Except for 0, these are the positive integers whose binary expansion has cuts-resistance 1. For the operation of shortening all runs by 1, cuts-resistance is the number of applications required to reach an empty word. Cuts-resistance 2 is A329862. - Gus Wiseman, Nov 27 2019
From Markus Sigg, Sep 14 2020: (Start)
Let s(k) be the length of the Collatz orbit of k, e.g. s(1) = 1, s(2) = 2, s(3) = 5. Then s(a(n)) = n+3 for n >= 3. Proof by induction: s(a(3)) = s(5) = 6 = 3+3. For odd n >= 5 we have s(a(n)) = s(4*a(n-2)+1) = s(12*a(n-2)+4)+1 = s(3*a(n-2)+1)+3 = s(a(n-2))+2 = (n-2)+3+2 = n+3, and for even n >= 4 this gives s(a(n)) = s(2*a(n-1)) = s(a(n-1))+1 = (n-1)+3+1 = n+3.
Conjecture: For n >= 3, a(n) is the second largest natural number whose Collatz orbit has length n+3. (End)
From Gary W. Adamson, May 14 2021: (Start)
With offset 1 the sequence equals the numbers of 1's from n = 1 to 3, 3 to 7, 7 to 15, ...; of A035263; as shown below:
..1 3 7 15...
..1 0 1 1 1 0 1 0 1 0 1 1 1 0 1...
..1.....2...........5......................10...; a(n) = Sum_(k=1..2n-1)A035263(k)
.....1...........2.......................5...; as to zeros.
..1's in the Tower of Hanoi game represent CW moves On disks in the pattern:
..0, 1, 2, 0, 1, 2, ... whereas even numbered disks move in the pattern:
..0, 2, 1, 0, 2, 1, ... (End)
Except for 0, numbers that are repunits in Gray-code representation (A014550). - Amiram Eldar, May 21 2021
From Gus Wiseman, Apr 20 2023: (Start)
Also the number of nonempty subsets of {1..n} with integer median, where the median of a multiset is the middle part in the odd-length case, and the average of the two middle parts in the even-length case. For example, the a(1) = 1 through a(4) = 10 subsets are:
{1} {1} {1} {1}
{2} {2} {2}
{3} {3}
{1,3} {4}
{1,2,3} {1,3}
{2,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
The complement is counted by A005578.
For mean instead of median we have A051293, counting empty sets A327475.
For normal multisets we have A056450, strongly normal A361202.
For partitions we have A325347, strict A359907, complement A307683.
(End)

Examples

			a(4)=10 since 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111 are the 10 binary strings switching 0000 to 1111.
a(3) = 1 because "lrc" is the only way to tie a tie with 3 half turns, namely, pass the business end of the tie behind the standing part to the left, bring across the front to the right, then behind to the center. The final motion of tucking the loose end down the front behind the "lr" piece is not considered a "step".
a(4) = 2 because "lrlc" is the only way to tie a tie with 4 half turns. Note that since the number of moves is even, the first step is to go to the left in front of the tie, not behind it. This knot is the standard "four in hand", the most commonly known men's tie knot. By contrast, the second most well known tie knot, the Windsor, is represented by "lcrlcrlc".
a(n) = (2^0 - 1) XOR (2^1 - 1) XOR (2^2 - 1) XOR (2^3 - 1) XOR ... XOR (2^n - 1). - _Paul D. Hanna_, Nov 05 2011
G.f. = x + 2*x^2 + 5*x^3 + 10*x^4 + 21*x^5 + 42*x^6 + 85*x^7 + 170*x^8 + ...
a(9) = 341 = 2^8 + 2^6 + 2^4 + 2^2 + 2^0 = 4^4 + 4^3 + 4^2 + 4^1 + 4^0 = A002450(5). a(10) = 682 = 2*a(9) = 2*A002450(5). - _Gregory L. Simay_, Sep 27 2017
		

References

  • Thomas Fink and Yong Mao, The 85 Ways to Tie a Tie, Broadway Books, New York (1999), p. 138.
  • Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009.

Crossrefs

Partial sums of A001045.
Row sums of triangle A013580.
Equals A026644/2.
Union of the bijections A002450 and A020988. - Robert G. Wilson v, Jun 09 2014
Column k=3 of A261139.
Complement of A107907.
Row 3 of A300653.
Other sequences that relate to the binary representation of the terms: A003714, A003754, A007088, A022290, A056830, A104161, A107909.

Programs

  • GAP
    List([0..35],n->(2^(n+1)-2+(n mod 2))/3); # Muniru A Asiru, Nov 01 2018
    
  • Haskell
    a000975 n = a000975_list !! n
    a000975_list = 0 : 1 : map (+ 1)
       (zipWith (+) (tail a000975_list) (map (* 2) a000975_list))
    -- Reinhard Zumkeller, Mar 07 2012
    
  • Magma
    [(2^(n+1) - 2 + (n mod 2))/3: n in [0..40]]; // Vincenzo Librandi, Mar 18 2015
    
  • Maple
    A000975 := proc(n) option remember; if n <= 1 then n else if n mod 2 = 0 then 2*A000975(n-1) else 2*A000975(n-1)+1 fi; fi; end;
    seq(iquo(2^n,3),n=1..33); # Zerinvary Lajos, Apr 20 2008
    f:=n-> if n mod 2 = 0 then (2^n-1)/3 else (2^n-2)/3; fi; [seq(f(n),n=0..40)]; # N. J. A. Sloane, Mar 21 2017
  • Mathematica
    Array[Ceiling[2(2^# - 1)/3] &, 41, 0]
    RecurrenceTable[{a[0] == 0, a[1] == 1, a[n] == a[n - 1] + 2a[n - 2] + 1}, a, {n, 40}] (* or *)
    LinearRecurrence[{2, 1, -2}, {0, 1, 2}, 40] (* Harvey P. Dale, Aug 10 2013 *)
    f[n_] := Block[{exp = n - 2}, Sum[2^i, {i, exp, 0, -2}]]; Array[f, 33] (* Robert G. Wilson v, Oct 30 2015 *)
    f[s_List] := Block[{a = s[[-1]]}, Append[s, If[OddQ@ Length@ s, 2a + 1, 2a]]]; Nest[f, {0}, 32] (* Robert G. Wilson v, Jul 20 2017 *)
    NestList[2# + Boole[EvenQ[#]] &, 0, 39] (* Alonso del Arte, Sep 21 2018 *)
  • PARI
    {a(n) = if( n<0, 0, 2 * 2^n \ 3)}; /* Michael Somos, Sep 04 2006 */
    
  • PARI
    a(n)=if(n<=0,0,bitxor(a(n-1),2^n-1)) \\ Paul D. Hanna, Nov 05 2011
    
  • PARI
    concat(0, Vec(x/(1-2*x-x^2+2*x^3) + O(x^100))) \\ Altug Alkan, Oct 30 2015
    
  • PARI
    {a(n) = (4*2^n - 3 - (-1)^n) / 6}; /* Michael Somos, Jul 23 2017 */
    
  • Python
    def a(n): return (2**(n+1) - 2 + (n%2))//3
    print([a(n) for n in range(35)]) # Michael S. Branicky, Dec 19 2021

Formula

a(n) = ceiling(2*(2^n-1)/3).
Alternating sum transform (PSumSIGN) of {2^n - 1} (A000225).
a(n) = a(n-1) + 2*a(n-2) + 1.
a(n) = 2*2^n/3 - 1/2 - (-1)^n/6.
a(n) = Sum_{i = 0..n} A001045(i), partial sums of A001045. - Bill Blewett
a(n) = n + 2*Sum_{k = 1..n-2} a(k).
G.f.: x/((1+x)*(1-x)*(1-2*x)) = x/(1-2*x-x^2+2*x^3). - Paul Barry, Feb 11 2003
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3). - Paul Barry, Feb 11 2003
a(n) = Sum_{k = 0..floor((n-1)/2)} 2^(n-2*k-1). - Paul Barry, Nov 11 2003
a(n+1) = Sum_{k=0..floor(n/2)} 2^(n-2*k); a(n+1) = Sum_{k = 0..n} Sum_{j = 0..k} (-1)^(j+k)*2^j. - Paul Barry, Nov 12 2003
(-1)^(n+1)*a(n) = Sum_{i = 0..n} Sum_{k = 1..i} k!*k* Stirling2(i, k)*(-1)^(k-1) = (1/3)*(-2)^(n+1)-(1/6)(3*(-1)^(n+1)-1). - Mario Catalani (mario.catalani(AT)unito.it), Dec 22 2003
a(n+1) = (n!/3)*Sum_{i - (-1)^i + j = n, i = 0..n, j = 0..n} 1/(i - (-1)^i)!/j!. - Benoit Cloitre, May 24 2004
a(n) = A001045(n+1) - A059841(n). - Paul Barry, Jul 22 2004
a(n) = Sum_{k = 0..n} 2^(n-k-1)*(1-(-1)^k), row sums of A130125. - Paul Barry, Jul 28 2004
a(n) = Sum_{k = 0..n} binomial(k, n-k+1)2^(n-k); a(n) = Sum_{k = 0..floor(n/2)} binomial(n-k, k+1)2^k. - Paul Barry, Oct 07 2004
a(n) = A107909(A104161(n)); A007088(a(n)) = A056830(n). - Reinhard Zumkeller, May 28 2005
a(n) = floor(2^(n+1)/3) = ceiling(2^(n+1)/3) - 1 = A005578(n+1) - 1. - Paul Barry, Oct 08 2005
Convolution of "Number of fixed points in all 231-avoiding involutions in S_n." (A059570) with "1-n" (A024000), treating the result as if offset was 0. - Graeme McRae, Jul 12 2006
a(n) = A081254(n) - 2^n. - Philippe Deléham, Oct 15 2006
Starting (1, 2, 5, 10, 21, 42, ...), these are the row sums of triangle A135228. - Gary W. Adamson, Nov 23 2007
Let T = the 3 X 3 matrix [1,1,0; 1,0,1; 0,1,1]. Then T^n * [1,0,0] = [A005578(n), A001045(n), a(n-1)]. - Gary W. Adamson, Dec 25 2007
2^n = 2*A005578(n-1) + 2*A001045(n) + 2*a(n-2). - Gary W. Adamson, Dec 25 2007
If we define f(m,j,x) = Sum_{k=j..m} binomial(m,k)*stirling2(k,j)*x^(m-k) then a(n-3) = (-1)^(n-1)*f(n,3,-2), (n >= 3). - Milan Janjic, Apr 26 2009
a(n) + A001045(n) = A166920(n). a(n) + A001045(n+2) = A051049(n+1). - Paul Curtz, Oct 29 2009
a(n) = floor(A051049(n+1)/3). - Gary Detlefs, Dec 19 2010
a(n) = round((2^(n+2)-3)/6) = floor((2^(n+1)-1)/3) = round((2^(n+1)-2)/3); a(n) = a(n-2) + 2^(n-1), n > 1. - Mircea Merca, Dec 27 2010
a(n) = binary XOR of 2^k-1 for k=0..n. - Paul D. Hanna, Nov 05 2011
E.g.f.: 2/3*exp(2*x) - 1/2*exp(x) - 1/6*exp(-x) = 2/3*U(0); U(k) = 1 - 3/(4*(2^k) - 4*(2^k)/(1+3*(-1)^k - 24*x*(2^k)/(8*x*(2^k)*(-1)^k - (k+1)/U(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
Starting with "1" = triangle A059260 * [1, 2, 2, 2, ...] as a vector. - Gary W. Adamson, Mar 06 2012
a(n) = 2*(2^n - 1)/3, for even n; a(n) = (2^(n+1) - 1)/3 = (1/3)*(2^((n+1)/2) - 1)*(2^((n+1)/2) + 1), for odd n. - Hieronymus Fischer, Nov 22 2012
a(n) + a(n+1) = 2^(n+1) - 1. - Arie Bos, Apr 03 2013
G.f.: Q(0)/(3*(1-x)), where Q(k) = 1 - 1/(4^k - 2*x*16^k/(2*x*4^k - 1/(1 + 1/(2*4^k - 8*x*16^k/(4*x*4^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 21 2013
floor(a(n+2)*3/5) = A077854(n), for n >= 0. - Armands Strazds, Sep 21 2014
a(n) = (2^(n+1) - 2 + (n mod 2))/3. - Paul Toms, Mar 18 2015
a(0) = 0, a(n) = 2*(a(n-1)) + (n mod 2). - Paul Toms, Mar 18 2015
Binary: a(n) = (a(n-1) shift left 1) + (a(n-1)) NOR (...11110). - Paul Toms, Mar 18 2015
Binary: for n > 1, a(n) = 2*a(n-1) OR a(n-2). - Stanislav Sykora, Nov 12 2015
a(n) = A266613(n) - 20*2^(n-5), for n > 2. - Andres Cicuttin, Mar 31 2016
From Michael Somos, Jul 23 2017: (Start)
a(n) = -(2^n)*a(-n) for even n; a(n) = -(2^(n+1))*a(-n) + 1 for odd n.
0 = +a(n)*(+2 +4*a(n) -4*a(n+1)) + a(n+1)*(-1 +a(n+1)) for all n in Z. (End)
G.f.: (x^1+x^3+x^5+x^7+...)/(1-2*x). - Gregory L. Simay, Sep 27 2017
a(n+1) = A051049(n) + A001045(n). - Yuchun Ji, Jul 12 2018
a(n) = A153772(n+3)/4. - Markus Sigg, Sep 14 2020
a(4*k+d) = 2^(d+1)*a(4*k-1) + a(d), a(n+4) = a(n) + 2^n*10, a(0..3) = [0,1,2,5]. So the last digit is always 0,1,2,5 repeated. - Yuchun Ji, May 22 2023

Extensions

Additional comments from Barry E. Williams, Jan 10 2000

A348377 Number of non-alternating compositions of n, excluding twins (x,x).

Original entry on oeis.org

0, 0, 0, 1, 3, 9, 19, 45, 98, 208, 436, 906, 1861, 3803, 7731, 15659, 31628, 63747, 128257, 257722, 517338, 1037652, 2079983, 4167325, 8346203, 16710572, 33449694, 66944254, 133959020, 268028868, 536231902, 1072737537, 2145905284, 4292486690, 8586035992
Offset: 0

Views

Author

Gus Wiseman, Oct 26 2021

Keywords

Comments

First differs from A348382 at a(6) = 19, A348382(6) = 17. The two non-alternating non-twin compositions of 6 that are not an anti-run are (1,2,3) and (3,2,1).
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2). Alternating permutations of multisets are a generalization of alternating or up-down permutations of {1..n}.

Examples

			The a(3) = 1 through a(6) = 19 compositions:
  (1,1,1)  (1,1,2)    (1,1,3)      (1,1,4)
           (2,1,1)    (1,2,2)      (1,2,3)
           (1,1,1,1)  (2,2,1)      (2,2,2)
                      (3,1,1)      (3,2,1)
                      (1,1,1,2)    (4,1,1)
                      (1,1,2,1)    (1,1,1,3)
                      (1,2,1,1)    (1,1,2,2)
                      (2,1,1,1)    (1,1,3,1)
                      (1,1,1,1,1)  (1,2,2,1)
                                   (1,3,1,1)
                                   (2,1,1,2)
                                   (2,2,1,1)
                                   (3,1,1,1)
                                   (1,1,1,1,2)
                                   (1,1,1,2,1)
                                   (1,1,2,1,1)
                                   (1,2,1,1,1)
                                   (2,1,1,1,1)
                                   (1,1,1,1,1,1)
		

Crossrefs

The version for patterns is A000670(n) - A344605(n).
Non-twin compositions are counted by A051049.
The complement is counted by A344604.
An unordered version is A344654.
The complement is ranked by A345167 \/ A007582.
These compositions are ranked by A345168 \ A007582.
Including twins gives A345192, complement A025047.
The version for factorizations is A347706, or A348380 with twins.
The non-anti-run case is A348382.
A001250 counts alternating permutations.
A011782 counts compositions, strict A032020.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A261983 counts non-anti-run compositions, complement A003242.
A325535 counts inseparable partitions, ranked by A335448.
A344614 counts compositions avoiding (1,2,3) and (3,2,1) adjacent.
A345165 = partitions with no alternating permutations, ranked by A345171.
A345170 = partitions with an alternating permutation, ranked by A345172.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]],{n,0,15}]

Formula

For n > 0, a(n) = A345192(n) - 1 if n is even; otherwise A345192(n).

Extensions

a(26) onwards from Andrew Howroyd, Jan 31 2024

A135356 Triangle T(n,k) read by rows: coefficients in the recurrence of sequences which equal their n-th differences.

Original entry on oeis.org

2, 2, 0, 3, -3, 2, 4, -6, 4, 0, 5, -10, 10, -5, 2, 6, -15, 20, -15, 6, 0, 7, -21, 35, -35, 21, -7, 2, 8, -28, 56, -70, 56, -28, 8, 0, 9, -36, 84, -126, 126, -84, 36, -9, 2, 10, -45, 120, -210, 252, -210, 120, -45, 10, 0, 11, -55, 165, -330, 462, -462, 330, -165, 55, -11, 2
Offset: 1

Views

Author

Paul Curtz, Dec 08 2007, Mar 25 2008, Apr 28 2008

Keywords

Comments

Sequences which equal their p-th differences obey recurrences a(n) = Sum_{s=1..p} T(p,s)*a(n-s).
This defines T(p,s) as essentially a signed version of a chopped Pascal triangle A014410, see A130785.
For cases like p=2, 4, 6, 8, 10, 12, 14, the denominator of the rational generating function of a(n) contains a factor 1-x; depending on the first terms in the sequences a(n), additional, simpler recurrences may exist if this cancels with a factor in the numerator. - R. J. Mathar, Jun 10 2008

Examples

			Triangle begins with row n=1:
  2;
  2,   0;
  3,  -3,  2;
  4,  -6,  4,    0;
  5, -10, 10,   -5,   2;
  6, -15, 20,  -15,   6,   0;
  7, -21, 35,  -35,  21,  -7,  2;
  8, -28, 56,  -70,  56, -28,  8,  0;
  9, -36, 84, -126, 126, -84, 36, -9, 2;
		

Crossrefs

Related sequences: A000079 (n=1), A131577 (n=2), (A131708 , A130785, A131562, A057079) (n=3), (A000749, A038503, A009545, A038505) (n=4), A133476 (n=5), A140343 (n=6), A140342 (n=7).

Programs

  • Magma
    A135356:= func< n,k | k eq n select 1-(-1)^n else (-1)^(k+1)*Binomial(n,k) >;
    [A135356(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 09 2023
    
  • Maple
    T:= (p, s)->  `if`(p=s, 2*irem(p, 2), (-1)^(s+1) *binomial(p, s)):
    seq(seq(T(p, s), s=1..p), p=1..11);  # Alois P. Heinz, Aug 26 2011
  • Mathematica
    T[p_, s_]:= If[p==s, 2*Mod[s, 2], (-1)^(s+1)*Binomial[p, s]];
    Table[T[p, s], {p, 12}, {s, p}]//Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)
  • SageMath
    def A135356(n,k):
        if (k==n): return 2*(n%2)
        else: return (-1)^(k+1)*binomial(n,k)
    flatten([[A135356(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Apr 09 2023

Formula

T(n,k) = (-1)^(k+1)*A007318(n, k). T(n,n) = 1 - (-1)^n.
Sum_{k=1..n} T(n, k) = 2.
From G. C. Greubel, Apr 09 2023: (Start)
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = 2*A051049(n-1).
Sum_{k=1..n-1} T(n, k) = (1 + (-1)^n).
Sum_{k=1..n-1} (-1)^(k-1)*T(n, k) = A000225(n-1).
T(2*n, n) = (-1)^(n-1)*A000984(n), n >= 1. (End)

Extensions

Edited by R. J. Mathar, Jun 10 2008

A083313 a(0)=1; a(n) = 3^n - 2^(n-1) for n >= 1.

Original entry on oeis.org

1, 2, 7, 23, 73, 227, 697, 2123, 6433, 19427, 58537, 176123, 529393, 1590227, 4774777, 14332523, 43013953, 129074627, 387289417, 1161999323, 3486260113, 10459304627, 31378962457, 94138984523, 282421147873, 847271832227, 2541832273897, 7625530376123
Offset: 0

Views

Author

Paul Barry, Apr 24 2003

Keywords

Comments

Essentially the same as A064686.
Binomial transform of A051049.
Number of skinny Boolean functions f(x_1,...,x_n) that are also Horn functions. - Hugo Pfoertner, Mar 04 2019

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, fascicle 1, section 7.1.4, pp. 134, 138, 139, 219, answer to exercise 172, Addison-Wesley, 2009.

Crossrefs

Cf. A083314.

Programs

  • Magma
    [(2*3^n-2^n+0^n)/2: n in [0..30]]; // Vincenzo Librandi, Feb 01 2015
  • Maple
    A083313 := proc(n)
        if n = 0 then
            1;
        else
            3^n-2^(n-1) ;
        end if;
    end proc: # R. J. Mathar, Aug 01 2013
  • Mathematica
    CoefficientList[Series[((1 - x) + (1 - 2 x) (1 - 3 x)) / (2 (1 - 2 x) (1 - 3 x)), {x, 0, 30}], x] (* Vincenzo Librandi, Feb 01 2015 *)
    LinearRecurrence[{5,-6},{1,2,7},30] (* Harvey P. Dale, Sep 04 2017 *)
  • PARI
    Vec(((1-x)+(1-2*x)*(1-3*x))/(2*(1-2*x)*(1-3*x)) + O(x^30)) \\ Michel Marcus, Jan 31 2015
    
  • PARI
    print1(1,", ",s=2,", " );for(k=2,27,s=2^(k-2)+3*s;print1(s,", ")) \\ Hugo Pfoertner, Mar 04 2019
    

Formula

a(n) = (2*3^n - (2^n - 0^n))/2.
a(0) = 1, a(n) = 3^n - 2^(n-1) for n >= 1.
G.f.: ((1-x) + (1-2*x)*(1-3*x))/(2*(1-2*x)*(1-3*x)).
E.g.f.: (2*exp(3*x) - exp(2*x) + exp(0))/2.
a(n) = A090888(n-1, 4), for n > 0. - Ross La Haye, Sep 21 2004
Let b(n) = 2*(3/2)^n - 1. Then A003063(n) = -b(1-n)*3^(n-1) for n > 0. a(n) = A064686(n) = b(n)*2^(n-1) for n > 0. - Michael Somos, Aug 06 2006
From Alex Ratushnyak, Jul 03 2012: (Start)
a(n) mod 100 = 23 for n = 4*k-1, k >= 1.
a(n) mod 100 = 27 for n = 4*k+1, k >= 1.
(End)

Extensions

Better name by Alex Ratushnyak, Jul 02 2012

A166920 a(n) = 2^n - (1 + (-1)^n)/2.

Original entry on oeis.org

0, 2, 3, 8, 15, 32, 63, 128, 255, 512, 1023, 2048, 4095, 8192, 16383, 32768, 65535, 131072, 262143, 524288, 1048575, 2097152, 4194303, 8388608, 16777215, 33554432, 67108863, 134217728, 268435455, 536870912, 1073741823, 2147483648, 4294967295
Offset: 0

Views

Author

Paul Curtz, Oct 23 2009

Keywords

Comments

Partial sums of A014551. The inverse binomial transform yields a sequence 0,2,-1,5,-7,17,...: zero followed by a sign alternating A014551.
The table of a(n) plus higher order differences in successive rows shows A131577 on the main diagonal.
a(n) = 2^n when n is odd and 2^n-1 when n is even. - Wesley Ivan Hurt, Nov 15 2013

Crossrefs

Programs

Formula

G.f.: x*(2-x)/((1-x)*(1-2*x)*(1+x)).
a(n) = 2^n - (1+(-1)^n)/2.
a(2*n) = A024036(n); a(2*n+1) = A004171(n).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - 2*a(n) = A168361(n).
a(n) = A000225(n+1) - A051049(n) = A014551(n) - A168361(n).
E.g.f.: exp(2*x) - cosh(x). - G. C. Greubel, May 28 2016
a(n) = Sum_{k=1..n+1} Sum_{i=0..n+1} C(n-k,i). - Wesley Ivan Hurt, Sep 22 2017
a(n) = 2*A001045(n) + A000975(n-1) for n>0. - Yuchun Ji, Aug 30 2018

Extensions

Edited and extended by R. J. Mathar, Mar 02 2010

A348382 Number of compositions of n that are not a twin (x,x) but have adjacent equal parts.

Original entry on oeis.org

0, 0, 0, 1, 3, 9, 17, 41, 88, 185, 387, 810, 1669, 3435, 7039, 14360, 29225, 59347, 120228, 243166, 491085, 990446, 1995409, 4016259, 8076959, 16231746, 32599773, 65437945, 131293191, 263316897, 527912139, 1058061751, 2120039884, 4246934012, 8505864639
Offset: 0

Views

Author

Gus Wiseman, Nov 05 2021

Keywords

Comments

A composition with no adjacent equal parts is also called a Carlitz composition, so these are non-twin, non-Carlitz compositions.

Examples

			The a(3) = 1 through a(6) = 17 compositions:
  (111)  (112)   (113)    (114)
         (211)   (122)    (222)
         (1111)  (221)    (411)
                 (311)    (1113)
                 (1112)   (1122)
                 (1121)   (1131)
                 (1211)   (1221)
                 (2111)   (1311)
                 (11111)  (2112)
                          (2211)
                          (3111)
                          (11112)
                          (11121)
                          (11211)
                          (12111)
                          (21111)
                          (111111)
		

Crossrefs

Allowing twins gives A261983, complement A003242.
The non-alternating case is A348377, difference A345195.
These compositions are ranked by A348612 \ A007582.
A001250 counts alternating permutations, complement A348615.
A007582 ranks twin compositions.
A011782 counts compositions, strict A032020.
A025047 counts alternating or wiggly compositions, complement A345192.
A051049 counts non-twin compositions, complement A000035(n+1).
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.

Programs

  • Mathematica
    nn=15;CoefficientList[Series[1+x/(1-2x)-x^2/(1-x^2)-1/(1-Sum[x^k/(1+x^k),{k,1,nn}]),{x,0,nn}],x]

Formula

For n > 0, a(n) = A261983(n) - A059841(n).
O.g.f.: 1 + x/(1-2x) - x^2/(1-x^2) - 1/(1 - Sum_{k>0} x^k/(1+x^k)).

A280410 Binary representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 261", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 10, 1, 1110, 1, 111110, 1, 11111110, 1, 1111111110, 1, 111111111110, 1, 11111111111110, 1, 1111111111111110, 1, 111111111111111110, 1, 11111111111111111110, 1, 1111111111111111111110, 1, 111111111111111111111110, 1, 11111111111111111111111110, 1
Offset: 0

Views

Author

Robert Price, Jan 02 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 261; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[1, i]], 10], {i, 1, stages - 1}]

Formula

Conjectures from Colin Barker, Jan 03 2017: (Start)
a(n) = 1 for n even.
a(n) = 10*(10^n - 1)/9 for n odd.
a(n) = 101*a(n-2) - 100*a(n-4) for n>3.
G.f.: (1 + 10*x - 100*x^2 + 100*x^3) / ((1 - x)*(1 + x)*(1 - 10*x)*(1 + 10*x)).
(End)

A280411 Binary representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 261", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 1, 100, 111, 10000, 11111, 1000000, 1111111, 100000000, 111111111, 10000000000, 11111111111, 1000000000000, 1111111111111, 100000000000000, 111111111111111, 10000000000000000, 11111111111111111, 1000000000000000000, 1111111111111111111
Offset: 0

Views

Author

Robert Price, Jan 02 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 261; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

Conjectures from Colin Barker, Jan 03 2017: (Start)
a(n) = 2^n*(4*(-5)^n + 5^(n + 1))/9 for n even.
a(n) = ((-5)^n*2^(n+2) + 2^n*5^(n+1) - 1)/9 for n odd.
a(n) = 101*a(n-2) - 100*a(n-4) for n>3.
G.f.: (1 + x - x^2 + 10*x^3) / ((1 - x)*(1 + x)*(1 - 10*x)*(1 + 10*x)).
(End)

A280412 Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 261", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 2, 1, 14, 1, 62, 1, 254, 1, 1022, 1, 4094, 1, 16382, 1, 65534, 1, 262142, 1, 1048574, 1, 4194302, 1, 16777214, 1, 67108862, 1, 268435454, 1, 1073741822, 1, 4294967294, 1, 17179869182, 1, 68719476734, 1, 274877906942, 1, 1099511627774, 1, 4398046511102, 1
Offset: 0

Views

Author

Robert Price, Jan 02 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 261; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[1, i]], 2], {i, 1, stages - 1}]

Formula

Conjectures from Ilya Gutkovskiy, Jan 02 2017: (Start)
G.f.: (1 + 2*x - 4*x^2 + 4*x^3)/((1 - 2*x)*(1 + 2*x)*(1 - x)*(1 + x)).
a(n) = 5*a(n-2) - 4*a(n-4).
(End)
Conjectures from Colin Barker, Jan 03 2017: (Start)
a(n) = 1 for n even.
a(n) = 2^(n+1) - 2 for n odd.
(End)
Showing 1-10 of 19 results. Next