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

A000295 Eulerian numbers (Euler's triangle: column k=2 of A008292, column k=1 of A173018).

Original entry on oeis.org

0, 0, 1, 4, 11, 26, 57, 120, 247, 502, 1013, 2036, 4083, 8178, 16369, 32752, 65519, 131054, 262125, 524268, 1048555, 2097130, 4194281, 8388584, 16777191, 33554406, 67108837, 134217700, 268435427, 536870882, 1073741793, 2147483616, 4294967263, 8589934558
Offset: 0

Views

Author

Keywords

Comments

There are 2 versions of Euler's triangle:
* A008292 Classic version of Euler's triangle used by Comtet (1974).
* A173018 Version of Euler's triangle used by Graham, Knuth and Patashnik in Concrete Math. (1990).
Euler's triangle rows and columns indexing conventions:
* A008292 The rows and columns of the Eulerian triangle are both indexed starting from 1. (Classic version: used in the classic books by Riordan and Comtet.)
* A173018 The rows and columns of the Eulerian triangle are both indexed starting from 0. (Graham et al.)
Number of Dyck paths of semilength n having exactly one long ascent (i.e., ascent of length at least two). Example: a(4)=11 because among the 14 Dyck paths of semilength 4, the paths that do not have exactly one long ascent are UDUDUDUD (no long ascent), UUDDUUDD and UUDUUDDD (two long ascents). Here U=(1,1) and D=(1,-1). Also number of ordered trees with n edges having exactly one branch node (i.e., vertex of outdegree at least two). - Emeric Deutsch, Feb 22 2004
Number of permutations of {1,2,...,n} with exactly one descent (i.e., permutations (p(1),p(2),...,p(n)) such that #{i: p(i)>p(i+1)}=1). E.g., a(3)=4 because the permutations of {1,2,3} with one descent are 132, 213, 231 and 312.
a(n+1) is the convolution of nonnegative integers (A001477) and powers of two (A000079). - Graeme McRae, Jun 07 2006
Partial sum of main diagonal of A125127. - Jonathan Vos Post, Nov 22 2006
Number of partitions of an n-set having exactly one block of size > 1. Example: a(4)=11 because, if the partitioned set is {1,2,3,4}, then we have 1234, 123|4, 124|3, 134|2, 1|234, 12|3|4, 13|2|4, 14|2|3, 1|23|4, 1|24|3 and 1|2|34. - Emeric Deutsch, Oct 28 2006
k divides a(k+1) for k in A014741. - Alexander Adamchuk, Nov 03 2006
(Number of permutations avoiding patterns 321, 2413, 3412, 21534) minus one. - Jean-Luc Baril, Nov 01 2007, Mar 21 2008
The chromatic invariant of the prism graph P_n for n >= 3. - Jonathan Vos Post, Aug 29 2008
Decimal integer corresponding to the result of XORing the binary representation of 2^n - 1 and the binary representation of n with leading zeros. This sequence and a few others are syntactically similar. For n > 0, let D(n) denote the decimal integer corresponding to the binary number having n consecutive 1's. Then D(n).OP.n represents the n-th term of a sequence when .OP. stands for a binary operator such as '+', '-', '*', 'quotentof', 'mod', 'choose'. We then get the various sequences A136556, A082495, A082482, A066524, A000295, A052944. Another syntactically similar sequence results when we take the n-th term as f(D(n)).OP.f(n). For example if f='factorial' and .OP.='/', we get (A136556)(A000295) ; if f='squaring' and .OP.='-', we get (A000295)(A052944). - K.V.Iyer, Mar 30 2009
Chromatic invariant of the prism graph Y_n.
Number of labelings of a full binary tree of height n-1, such that each path from root to any leaf contains each label from {1,2,...,n-1} exactly once. - Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009
Also number of nontrivial equivalence classes generated by the weak associative law X((YZ)T)=(X(YZ))T on words with n open and n closed parentheses. Also the number of join (resp. meet)-irreducible elements in the pruning-grafting lattice of binary trees with n leaves. - Jean Pallo, Jan 08 2010
Nonzero terms of this sequence can be found from the row sums of the third sub-triangle extracted from Pascal's triangle as indicated below by braces:
1;
1, 1;
{1}, 2, 1;
{1, 3}, 3, 1;
{1, 4, 6}, 4, 1;
{1, 5, 10, 10}, 5, 1;
{1, 6, 15, 20, 15}, 6, 1;
... - L. Edson Jeffery, Dec 28 2011
For integers a, b, denote by a<+>b the least c >= a, such that the Hamming distance D(a,c) = b (note that, generally speaking, a<+>b differs from b<+>a). Then for n >= 3, a(n) = n<+>n. This has a simple explanation: for n >= 3 in binary we have a(n) = (2^n-1)-n = "anti n". - Vladimir Shevelev, Feb 14 2012
a(n) is the number of binary sequences of length n having at least one pair 01. - Branko Curgus, May 23 2012
Nonzero terms are those integers k for which there exists a perfect (Hamming) error-correcting code. - L. Edson Jeffery, Nov 28 2012
a(n) is the number of length n binary words constructed in the following manner: Select two positions in which to place the first two 0's of the word. Fill in all (possibly none) of the positions before the second 0 with 1's and then complete the word with an arbitrary string of 0's or 1's. So a(n) = Sum_{k=2..n} (k-1)*2^(n-k). - Geoffrey Critzer, Dec 12 2013
Without first 0: a(n)/2^n equals Sum_{k=0..n} k/2^k. For example: a(5)=57, 57/32 = 0/1 + 1/2 + 2/4 + 3/8 + 4/16 + 5/32. - Bob Selcoe, Feb 25 2014
The first barycentric coordinate of the centroid of the first n rows of Pascal's triangle, assuming the numbers are weights, is A000295(n+1)/A000337(n). See attached figure. - César Eliud Lozada, Nov 14 2014
Starting (0, 1, 4, 11, ...), this is the binomial transform of (0, 1, 2, 2, 2, ...). - Gary W. Adamson, Jul 27 2015
Also the number of (non-null) connected induced subgraphs in the n-triangular honeycomb rook graph. - Eric W. Weisstein, Aug 27 2017
a(n) is the number of swaps needed in the worst case to transform a binary tree with n full levels into a heap, using (bottom-up) heapify. - Rudy van Vliet, Sep 19 2017
The utility of large networks, particularly social networks, with n participants is given by the terms a(n) of this sequence. This assertion is known as Reed's Law, see the Wikipedia link. - Johannes W. Meijer, Jun 03 2019
a(n-1) is the number of subsets of {1..n} in which the largest element of the set exceeds by at least 2 the next largest element. For example, for n = 5, a(4) = 11 and the 11 sets are {1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {3,5}, {1,2,4}, {1,2,5}, {1,3,5}, {2,3,5}, {1,2,3,5}. - Enrique Navarrete, Apr 08 2020
a(n-1) is also the number of subsets of {1..n} in which the second smallest element of the set exceeds by at least 2 the smallest element. For example, for n = 5, a(4) = 11 and the 11 sets are {1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {3,5}, {1,3,4}, {1,3,5}, {1,4,5}, {2,4,5}, {1,3,4,5}. - Enrique Navarrete, Apr 09 2020
a(n+1) is the sum of the smallest elements of all subsets of {1..n}. For example, for n=3, a(4)=11; the subsets of {1,2,3} are {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}, and the sum of smallest elements is 11. - Enrique Navarrete, Aug 20 2020
Number of subsets of an n-set that have more than one element. - Eric M. Schmidt, Mar 13 2021
Number of individual bets in a "full cover" bet on n-1 horses, dogs, etc. in different races. Each horse, etc. can be bet on or not, giving 2^n bets. But, by convention, singles (a bet on only one race) are not included, reducing the total number bets by n. It is also impossible to bet on no horses at all, reducing the number of bets by another 1. A full cover on 4 horses, dogs, etc. is therefore 6 doubles, 4 trebles and 1 four-horse etc. accumulator. In British betting, such a bet on 4 horses etc. is a Yankee; on 5, a super-Yankee. - Paul Duckett, Nov 17 2021
From Enrique Navarrete, May 25 2022: (Start)
Number of binary sequences of length n with at least two 1's.
a(n-1) is the number of ways to choose an odd number of elements greater than or equal to 3 out of n elements.
a(n+1) is the number of ways to split [n] = {1,2,...,n} into two (possibly empty) complementary intervals {1,2,...,i} and {i+1,i+2,...,n} and then select a subset from the first interval (2^i choices, 0 <= i <= n), and one block/cell (i.e., subinterval) from the second interval (n-i choices, 0 <= i <= n).
(End)
Number of possible conjunctions in a system of n planets; for example, there can be 0 conjunctions with one planet, one with two planets, four with three planets (three pairs of planets plus one with all three) and so on. - Wendy Appleby, Jan 02 2023
Largest exponent m such that 2^m divides (2^n-1)!. - Franz Vrabec, Aug 18 2023
It seems that a(n-1) is the number of odd r with 0 < r < 2^n for which there exist u,v,w in the x-independent beginning of the Collatz trajectory of 2^n x + r with u+v = w+1, as detailed in the link "Collatz iteration and Euler numbers?". A better understanding of this might also give a formula for A374527. - Markus Sigg, Aug 02 2024
This sequence has a connection to consecutively halved positional voting (CHPV); see Mendenhall and Switkay. - Hal M. Switkay, Feb 25 2025
a(n) is the number of subsets of size 2 and more of an n-element set. Equivalently, a(n) is the number of (hyper)edges of size 2 and more in a complete hypergraph of n vertices. - Yigit Oktar, Apr 05 2025

Examples

			G.f. = x^2 + 4*x^3 + 11*x^4 + 26*x^5 + 57*x^6 + 120*x^7 + 247*x^8 + 502*x^9 + ...
		

References

  • O. Bottema, Problem #562, Nieuw Archief voor Wiskunde, 28 (1980) 115.
  • L. Comtet, "Permutations by Number of Rises; Eulerian Numbers." Section 6.5 in Advanced Combinatorics: The Art of Finite and Infinite Expansions, rev. enl. ed. Dordrecht, Netherlands: Reidel, pp. 51 and 240-246, 1974.
  • F. N. David and D. E. Barton, Combinatorial Chance. Hafner, NY, 1962, p. 151.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, p. 34.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 215.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A008292 (classic version of Euler's triangle used by Comtet (1974)).
Cf. A173018 (version of Euler's triangle used by Graham, Knuth and Patashnik in Concrete Math. (1990)).
Cf. A002662 (partial sums).
Partial sums of A000225.
Row sums of A014473 and of A143291.
Second column of triangles A112493 and A112500.
Sequences A125128 and A130103 are essentially the same.
Column k=1 of A124324.

Programs

  • Haskell
    a000295 n = 2^n - n - 1  -- Reinhard Zumkeller, Nov 25 2013
    
  • Magma
    [2^n-n-1: n in [0..40]]; // Vincenzo Librandi, Jul 29 2015
    
  • Magma
    [EulerianNumber(n, 1): n in [0..40]]; // G. C. Greubel, Oct 02 2024
    
  • Maple
    [ seq(2^n-n-1, n=1..50) ];
    A000295 := -z/(2*z-1)/(z-1)**2; # Simon Plouffe in his 1992 dissertation
    # Grammar specification:
    spec := [S, { B = Set(Z, 1 <= card), C = Sequence(B, 2 <= card), S = Prod(B, C) }, unlabeled]:
    struct := n -> combstruct[count](spec, size = n+1);
    seq(struct(n), n = 0..33); # Peter Luschny, Jul 22 2014
  • Mathematica
    a[n_] = If[n==0, 0, n*(HypergeometricPFQ[{1, 1-n}, {2}, -1] - 1)];
    Table[a[n], {n,0,40}] (* Olivier Gérard, Mar 29 2011 *)
    LinearRecurrence[{4, -5, 2}, {0, 0, 1}, 40] (* Vincenzo Librandi, Jul 29 2015 *)
    Table[2^n -n-1, {n,0,40}] (* Eric W. Weisstein, Nov 16 2017 *)
  • PARI
    a(n)=2^n-n-1 \\ Charles R Greathouse IV, Jun 10 2011
    
  • SageMath
    [2^n -(n+1) for n in range(41)] # G. C. Greubel, Oct 02 2024

Formula

a(n) = 2^n - n - 1.
G.f.: x^2/((1-2*x)*(1-x)^2).
A107907(a(n+2)) = A000079(n+2). - Reinhard Zumkeller, May 28 2005
E.g.f.: exp(x)*(exp(x)-1-x). - Emeric Deutsch, Oct 28 2006
a(0)=0, a(1)=0, a(n) = 3*a(n-1) - 2*a(n-2) + 1. - Miklos Kristof, Mar 09 2005
a(0)=0, a(n) = 2*a(n-1) + n - 1 for all n in Z.
a(n) = Sum_{k=2..n} binomial(n, k). - Paul Barry, Jun 05 2003
a(n+1) = Sum_{i=1..n} Sum_{j=1..i} C(i, j). - Benoit Cloitre, Sep 07 2003
a(n+1) = 2^n*Sum_{k=0..n} k/2^k. - Benoit Cloitre, Oct 26 2003
a(0)=0, a(1)=0, a(n) = Sum_{i=0..n-1} i+a(i) for i > 1. - Gerald McGarvey, Jun 12 2004
a(n+1) = Sum_{k=0..n} (n-k)*2^k. - Paul Barry, Jul 29 2004
a(n) = Sum_{k=0..n} binomial(n, k+2); a(n+2) = Sum_{k=0..n} binomial(n+2, k+2). - Paul Barry, Aug 23 2004
a(n) = Sum_{k=0..floor((n-1)/2)} binomial(n-k-1, k+1)*2^(n-k-2)*(-1/2)^k. - Paul Barry, Oct 25 2004
a(0) = 0; a(n) = Stirling2(n,2) + a(n-1) = A000225(n-1) + a(n-1). - Thomas Wieder, Feb 18 2007
a(n) = A000325(n) - 1. - Jonathan Vos Post, Aug 29 2008
a(0) = 0, a(n) = Sum_{k=0..n-1} 2^k - 1. - Doug Bell, Jan 19 2009
a(n) = A000217(n-1) + A002662(n) for n>0. - Geoffrey Critzer, Feb 11 2009
a(n) = A000225(n) - n. - Zerinvary Lajos, May 29 2009
a(n) = n*(2F1([1,1-n],[2],-1) - 1). - Olivier Gérard, Mar 29 2011
Column k=1 of A173018 starts a'(n) = 0, 1, 4, 11, ... and has the hypergeometric representation n*hypergeom([1, -n+1], [-n], 2). This can be seen as a formal argument to prefer Euler's A173018 over A008292. - Peter Luschny, Sep 19 2014
E.g.f.: exp(x)*(exp(x)-1-x); this is U(0) where U(k) = 1 - x/(2^k - 2^k/(x + 1 - x^2*2^(k+1)/(x*2^(k+1) - (k+1)/U(k+1)))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Dec 01 2012
a(n) = A079583(n) - A000225(n+1). - Miquel Cerda, Dec 25 2016
a(0) = 0; a(1) = 0; for n > 1: a(n) = Sum_{i=1..2^(n-1)-1} A001511(i). - David Siegers, Feb 26 2019
a(n) = A007814(A028366(n)). - Franz Vrabec, Aug 18 2023
a(n) = Sum_{k=1..floor((n+1)/2)} binomial(n+1, 2*k+1). - Taras Goy, Jan 02 2025

A008466 a(n) = 2^n - Fibonacci(n+2).

Original entry on oeis.org

0, 0, 1, 3, 8, 19, 43, 94, 201, 423, 880, 1815, 3719, 7582, 15397, 31171, 62952, 126891, 255379, 513342, 1030865, 2068495, 4147936, 8313583, 16655823, 33358014, 66791053, 133703499, 267603416, 535524643, 1071563515, 2143959070, 4289264409, 8580707127
Offset: 0

Views

Author

Keywords

Comments

Toss a fair coin n times; a(n) is number of possible outcomes having a run of 2 or more heads.
Also the number of binary words of length n with at least two neighboring 1 digits. For example, a(4)=8 because 8 binary words of length 4 have two or more neighboring 1 digits: 0011, 0110, 0111, 1011, 1100, 1101, 1110, 1111 (cf. A143291). - Alois P. Heinz, Jul 18 2008
Equivalently, number of solutions (x_1, ..., x_n) to the equation x_1*x_2 + x_2*x_3 + x_3*x_4 + ... + x_{n-1}*x_n = 1 in base-2 lunar arithmetic. - N. J. A. Sloane, Apr 23 2011
Row sums of triangle A153281 = (1, 3, 8, 19, 43, ...). - Gary W. Adamson, Dec 23 2008
a(n-1) is the number of compositions of n with at least one part >= 3. - Joerg Arndt, Aug 06 2012
One less than the cardinality of the set of possible numbers of (leaf-) nodes of AVL trees with height n (cf. A143897, A217298). a(3) = 4-1, the set of possible numbers of (leaf-) nodes of AVL trees with height 3 is {5,6,7,8}. - Alois P. Heinz, Mar 20 2013
a(n) is the number of binary words of length n such that some prefix contains three more 1's than 0's or two more 0's than 1's. a(4) = 8 because we have: {0,0,0,0}, {0,0,0,1}, {0,0,1,0}, {0,0,1,1}, {0,1,0,0}, {1,0,0,0}, {1,1,1,0}, {1,1,1,1}. - Geoffrey Critzer, Dec 30 2013
With offset 0: antidiagonal sums of P(j,n) array of j-th partial sums of Fibonacci numbers. - Luciano Ancora, Apr 26 2015

Examples

			From _Gus Wiseman_, Jun 25 2020: (Start)
The a(2) = 1 through a(5) = 19 compositions of n + 1 with at least one part >= 3 are:
  (3)  (4)    (5)      (6)
       (1,3)  (1,4)    (1,5)
       (3,1)  (2,3)    (2,4)
              (3,2)    (3,3)
              (4,1)    (4,2)
              (1,1,3)  (5,1)
              (1,3,1)  (1,1,4)
              (3,1,1)  (1,2,3)
                       (1,3,2)
                       (1,4,1)
                       (2,1,3)
                       (2,3,1)
                       (3,1,2)
                       (3,2,1)
                       (4,1,1)
                       (1,1,1,3)
                       (1,1,3,1)
                       (1,3,1,1)
                       (3,1,1,1)
(End)
		

References

  • W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 2nd ed. New York: Wiley, p. 300, 1968.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 14, Exercise 1.

Crossrefs

Cf. A153281, A186244 (ternary words), A335457, A335458, A335516.
The non-contiguous version is A335455.
Row 2 of A340156. Column 3 of A109435.

Programs

  • Magma
    [2^n-Fibonacci(n+2): n in [0..40]]; // Vincenzo Librandi, Apr 27 2015
    
  • Maple
    a:= n-> (<<3|1|0>, <-1|0|1>, <-2|0|0>>^n)[1, 3]:
    seq(a(n), n=0..50); # Alois P. Heinz, Jul 18 2008
    # second Maple program:
    with(combinat): F:=fibonacci; f:=n->add(2^(n-1-i)*F(i),i=0..n-1); [seq(f(n),n=0..50)]; # N. J. A. Sloane, Mar 31 2014
  • Mathematica
    Table[2^n-Fibonacci[n+2],{n,0,20}] (* Vladimir Joseph Stephan Orlovsky, Jul 22 2008 *)
    MMM = 30;
    For[ M=2, M <= MMM, M++,
    vlist = Array[x, M];
    cl[i_] := And[ x[i], x[i+1] ];
    cl2 = False; For [ i=1, i <= M-1, i++, cl2 = Or[cl2, cl[i]] ];
    R[M] = SatisfiabilityCount[ cl2, vlist ] ]
    Table[ R[M], {M,2,MMM}]
    (* Find Boolean values of variables that satisfy the formula x1 x2 + x2 x3 + ... + xn-1 xn = 1; N. J. A. Sloane, Apr 23 2011 *)
    LinearRecurrence[{3,-1,-2},{0,0,1},40] (* Harvey P. Dale, Aug 09 2013 *)
    nn=33; a=1/(1-2x); b=1/(1-2x^2-x^4-x^6/(1-x^2));
    CoefficientList[Series[b(a x^3/(1-x^2)+x^2a),{x,0,nn}],x] (* Geoffrey Critzer, Dec 30 2013 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n+1],Max@@#>2&]],{n,0,10}] (* Gus Wiseman, Jun 25 2020 *)
  • PARI
    a(n) = 2^n-fibonacci(n+2) \\ Charles R Greathouse IV, Feb 03 2014
    
  • SageMath
    def A008466(n): return 2^n - fibonacci(n+2) # G. C. Greubel, Apr 23 2025

Formula

a(1)=0, a(2)=1, a(3)=3, a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3). - Miklos Kristof, Nov 24 2003
G.f.: x^2/((1-2*x)*(1-x-x^2)). - Paul Barry, Feb 16 2004
From Paul Barry, May 19 2004: (Start)
Convolution of Fibonacci(n) and (2^n - 0^n)/2.
a(n) = Sum_{k=0..n} (2^k-0^k)*Fibonacci(n-k)/2.
a(n+1) = Sum_{k=0..n} Fibonacci(k)*2^(n-k).
a(n) = 2^n*Sum_{k=0..n} Fibonacci(k)/2^k. (End)
a(n) = a(n-1) + a(n-2) + 2^(n-2). - Jon Stadler (jstadler(AT)capital.edu), Aug 21 2006
a(n) = 2*a(n-1) + Fibonacci(n-1). - Thomas M. Green, Aug 21 2007
a(n) = term (1,3) in the 3 X 3 matrix [3,1,0; -1,0,1; -2,0,0]^n. - Alois P. Heinz, Jul 18 2008
a(n) = 2*a(n-1) - a(n-3) + 2^(n-3). - Carmine Suriano, Mar 08 2011

A141539 Square array A(n,k) of numbers of length n binary words with at least k "0" between any two "1" digits (n,k >= 0), read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 3, 8, 1, 2, 3, 5, 16, 1, 2, 3, 4, 8, 32, 1, 2, 3, 4, 6, 13, 64, 1, 2, 3, 4, 5, 9, 21, 128, 1, 2, 3, 4, 5, 7, 13, 34, 256, 1, 2, 3, 4, 5, 6, 10, 19, 55, 512, 1, 2, 3, 4, 5, 6, 8, 14, 28, 89, 1024, 1, 2, 3, 4, 5, 6, 7, 11, 19, 41, 144, 2048, 1, 2, 3, 4, 5, 6, 7, 9, 15, 26, 60, 233, 4096
Offset: 0

Views

Author

Alois P. Heinz, Aug 15 2008

Keywords

Comments

A(n,k+1) = A(n,k) - A143291(n,k).
From Gary W. Adamson, Dec 19 2009: (Start)
Alternative method generated from variants of an infinite lower triangle T(n) = A000012 = (1; 1,1; 1,1,1; ...) such that T(n) has the leftmost column shifted up n times. Then take lim_{k->infinity} T(n)^k, obtaining a left-shifted vector considered as rows of an array (deleting the first 1) as follows:
1, 2, 4, 8, 16, 32, 64, 128, 256, ... = powers of 2
1, 1, 2, 3, 5, 8, 13, 21, 34, ... = Fibonacci numbers
1, 1, 1, 2, 3, 4, 6, 9, 13, ... = A000930
1, 1, 1, 1, 2, 3, 4, 5, 7, ... = A003269
... with the next rows A003520, A005708, A005709, ... such that beginning with the Fibonacci row, the succession of rows are recursive sequences generated from a(n) = a(n-1) + a(n-2); a(n) = a(n-1) + a(n-3), ... a(n) = a(n-1) + a(n-k); k = 2,3,4,... Last, columns going up from the topmost 1 become rows of triangle A141539. (End)

Examples

			A(4,2) = 6, because 6 binary words of length 4 have at least 2 "0" between any two "1" digits: 0000, 0001, 0010, 0100, 1000, 1001.
Square array A(n,k) begins:
    1,  1,  1,  1,  1,  1,  1,  1, ...
    2,  2,  2,  2,  2,  2,  2,  2, ...
    4,  3,  3,  3,  3,  3,  3,  3, ...
    8,  5,  4,  4,  4,  4,  4,  4, ...
   16,  8,  6,  5,  5,  5,  5,  5, ...
   32, 13,  9,  7,  6,  6,  6,  6, ...
   64, 21, 13, 10,  8,  7,  7,  7, ...
  128, 34, 19, 14, 11,  9,  8,  8, ...
		

Crossrefs

Cf. column k=0: A000079, k=1: A000045(n+2), k=2: A000930(n+2), A068921, A078012(n+5), k=3: A003269(n+4), A017898(n+7), k=4: A003520(n+4), A017899(n+9), k=5: A005708(n+5), A017900(n+11), k=6: A005709(n+6), A017901(n+13), k=7: A005710(n+7), A017902(n+15), k=8: A005711(n+7), A017903(n+17), k=9: A017904(n+19), k=10: A017905(n+21), k=11: A017906(n+23), k=12: A017907(n+25), k=13: A017908(n+27), k=14: A017909(n+29).
Main diagonal gives A000027(n+1).
A(2n,n) gives A000217(n+1)
A(3n,n) gives A008778.
A(3n,2n) gives A034856(n+1).
A(2n,3n) gives A005408.
A(2^n-1,n) gives A376697.
See also A143291.

Programs

  • Maple
    A:= proc(n, k) option remember;
          if k=0 then 2^n
        elif n<=k and n>=0 then n+1
        elif n>0 then A(n-1, k) +A(n-k-1, k)
        else          A(n+1+k, k) -A(n+k, k)
          fi
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    a[n_, k_] := a[n, k] = Which[k == 0, 2^n, n <= k && n >= 0, n+1, n > 0, a[n-1, k] + a[n-k-1, k], True, a[n+1+k, k] - a[n+k, k]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Dec 17 2013, translated from Maple *)

Formula

G.f. of column k: x^(-k)/(1-x-x^(k+1)).
A(n,k) = 2^n if k=0, otherwise A(n,k) = n+1 if n<=k, otherwise A(n,k) = A(n-1,k) + A(n-k-1,k).

A143281 Number of binary words of length n containing at least one subword 101 and no subword 11.

Original entry on oeis.org

0, 0, 0, 1, 2, 4, 8, 15, 27, 48, 84, 145, 248, 421, 710, 1191, 1989, 3309, 5487, 9073, 14966, 24634, 40472, 66384, 108729, 177858, 290610, 474364, 773615, 1260643, 2052818, 3340662, 5433345, 8832432, 14351403, 23309326, 37844645, 61423513, 99663191, 161665653
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(6)=8 because 8 binary words of length 6 have at least one substring 101 and no substring 11: 000101, 001010, 010100, 101000, 010101, 101010, 101001, 100101.
		

Crossrefs

Cf. A000045, A000930, first column of A143291.

Programs

  • Maple
    a:= n-> coeff(series(x^3/((x^2+x-1)*(x^3+x-1)), x, n+1), x, n):
    seq(a(n), n=0..60);
  • Mathematica
    CoefficientList[Series[x^3/((x^2+x-1)*(x^3+x-1)), {x, 0, 50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    x='x+O('x^50); concat([0,0,0], Vec(x^3/((x^2+x-1)*(x^3+x-1)))) \\ G. C. Greubel, Apr 28 2017

Formula

G.f.: x^3/((x^2+x-1)*(x^3+x-1)).
a(n) = A000045(n+2)-A000930(n+2).

A143282 Number of binary words of length n containing at least one subword 1001 and no subwords 10^{i}1 with i<2.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 5, 9, 15, 24, 38, 60, 94, 146, 225, 345, 527, 802, 1216, 1838, 2771, 4168, 6256, 9372, 14016, 20929, 31208, 46476, 69133, 102726, 152494, 226171, 335169, 496320, 734440, 1086102, 1605187, 2371049, 3500522, 5165573, 7619251
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(7) = 5 because 5 binary words of length 7 have at least one subword 1001 and no subwords 11 or 101: 0001001, 0010010, 0100100, 1001000, 1001001.
		

Crossrefs

Cf. A000930, A003269, 2nd column of A143291.

Programs

  • Maple
    a:= n-> (Matrix (7, (i, j)-> `if` (i=j-1, 1, `if` (i=7, [-1, 0, -1, 0, 1, -1, 2][j], 0)))^n. <<(0$6), 1>>)[3, 1]: seq (a(n), n=0..50);
  • Mathematica
    CoefficientList[Series[x^4/((x^3+x-1)*(x^4+x-1)), {x,0,50}], x] (* G. C. Greubel, Apr 29 2017 *)
  • PARI
    x='x+O('x^50); concat([0,0,0,0], Vec(x^4/((x^3+x-1)*(x^4+x-1)))) \\ G. C. Greubel, Apr 29 2017

Formula

G.f.: x^4/((x^3+x-1)*(x^4+x-1)).
a(n) = A000930(n+2) - A003269(n+4).

A143283 Number of binary words of length n containing at least one subword 10001 and no subwords 10^{i}1 with i<3.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 10, 16, 24, 35, 51, 75, 110, 160, 231, 332, 476, 681, 972, 1384, 1966, 2787, 3944, 5573, 7864, 11082, 15597, 21926, 30791, 43199, 60553, 84807, 118682, 165966, 231930, 323905, 452083, 630629, 879224, 1225205, 1706532, 2375901
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(9) = 6 because 6 binary words of length 8 have at least one subword 10001 and no subwords 11, 101 or 1001: 000010001, 000100010, 001000100, 010001000, 100010000, 100010001.
		

Crossrefs

Cf. A003269, A003520, 3rd column of A143291.

Programs

  • Maple
    a:= proc(m) local M;
          M:= Matrix (2*m+3, (i, j)-> `if` (i=j-1 and i<>m+1 or j=1 and
                      i in [1, m+1] or j=m+2 and i in [m+2, 2*m+3], 1, 0));
          proc(n) local K; K:= M^(n+m+1); K[m+1, 1] -K[m+2, m+2] end
        end(3):
    seq (a(n), n=0..55);

Formula

G.f.: x^5/((x^4+x-1)*(x^5+x-1)).
a(n) = A003269(n+4) - A003520(n+4).

A143284 Number of binary words of length n containing at least one subword 100001 and no subwords 10^{i}1 with i<4.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 11, 17, 25, 35, 48, 66, 92, 129, 180, 249, 342, 468, 640, 875, 1195, 1629, 2216, 3009, 4080, 5526, 7477, 10107, 13649, 18415, 24823, 33433, 44995, 60513, 81330, 109241, 146644, 196742, 263813, 353570, 473640, 634201
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(7)=2 because 2 binary words of length 7 have at least one subword 100001 and no subwords 10^{i}1 with i<4: 0100001, 1000010.
		

Crossrefs

Cf. A003520, A005708, 4th column of A143291.

Programs

  • Magma
    [n le 6 select 0 else n le 11 select n-6 else 2*Self(n-1)-Self(n-2) +Self(n-5)-Self(n-7)-Self(n-11): n in [1..60]]; // Vincenzo Librandi, Jun 05 2013
  • Maple
    a:= n-> coeff(series(x^6/((x^5+x-1)*(x^6+x-1)), x, n+1), x, n):
    seq(a(n), n=0..60);
  • Mathematica
    CoefficientList[Series[x^6 / ((x^5 + x - 1) (x^6 + x - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Jun 04 2013 *)

Formula

G.f.: x^6/((x^5+x-1)*(x^6+x-1)).
a(n) = A003520(n+4) - A005708(n+5).
a(n) = 2*a(n-1)-a(n-2)+a(n-5)-a(n-7)-a(n-11). - Vincenzo Librandi, Jun 05 2013

A143285 Number of binary words of length n containing at least one subword 1000001 and no subwords 10^{i}1 with i<5.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 8, 12, 18, 26, 36, 48, 63, 83, 111, 150, 203, 273, 364, 482, 636, 839, 1108, 1464, 1933, 2548, 3352, 4402, 5774, 7568, 9914, 12980, 16983, 22204, 29008, 37870, 49408, 64425, 83963, 109373, 142406, 185331, 241088, 313486
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(8)=2 because 2 binary words of length 8 have at least one subword 1000001 and no subwords 10^{i}1 with i<5: 01000001, 10000010.
		

Crossrefs

Cf. A005708, A005709, 5th column of A143291.

Programs

  • Magma
    [n le 7 select 0 else n le 13 select n-7 else 2*Self(n-1)-Self(n-2) +Self(n-6)-Self(n-8)-Self(n-13): n in [1..60]]; // Vincenzo Librandi, Jun 05 2013
  • Maple
    a:= n-> coeff(series(x^7/((x^6+x-1)*(x^7+x-1)), x, n+1), x, n):
    seq(a(n), n=0..60);
  • Mathematica
    CoefficientList[Series[x^7 / ((x^6 + x - 1) (x^7 + x - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Jun 04 2013 *)

Formula

G.f.: x^7/((x^6+x-1)*(x^7+x-1)).
a(n) = A005708(n+5) - A005709(n+6).
a(n) = 2*a(n-1) -a(n-2) +a(n-6) -a(n-8) -a(n-13). - Vincenzo Librandi, Jun 05 2013

A143286 Number of binary words of length n containing at least one subword 10^{6}1 and no subwords 10^{i}1 with i<6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 9, 13, 19, 27, 37, 49, 63, 80, 102, 132, 173, 228, 300, 392, 508, 654, 839, 1076, 1382, 1778, 2289, 2945, 3783, 4850, 6207, 7934, 10135, 12943, 16526, 21095, 26915, 34320, 43733, 55692, 70882, 90174, 114673, 145778
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(9)=2 because 2 binary words of length 9 have at least one subword 10^{6}1 and no subwords 10^{i}1 with i<6: 010000001, 100000010.
		

Crossrefs

Cf. A005709, A005710, 6th column of A143291.

Programs

  • Magma
    [n le 8 select 0 else n le 15 select n-8 else 2*Self(n-1)-Self(n-2) +Self(n-7)-Self(n-9)-Self(n-15): n in [1..60]]; // Vincenzo Librandi, Jun 05 2013
  • Maple
    a:= n-> coeff(series(x^8/((x^7+x-1)*(x^8+x-1)), x, n+1), x, n):
    seq(a(n), n=0..60);
  • Mathematica
    CoefficientList[Series[x^8 / ((x^7 + x - 1) (x^8 + x - 1)), {x, 0, 60}], x] (* Vincenzo Librandi, Jun 04 2013 *)

Formula

G.f.: x^8/((x^7+x-1)*(x^8+x-1)).
a(n) = A005709(n+6)-A005710(n+7).
a(n) = 2*a(n-1) - a(n-2) + a(n-7) - a(n-9) - a(n-15). - Vincenzo Librandi, Jun 05 2013

A143287 Number of binary words of length n containing at least one subword 10^{7}1 and no subwords 10^{i}1 with i<7.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 14, 20, 28, 38, 50, 64, 80, 99, 123, 155, 198, 255, 329, 423, 540, 684, 861, 1080, 1354, 1700, 2139, 2696, 3400, 4285, 5392, 6772, 8490, 10630, 13300, 16637, 20812, 26036, 32568, 40726, 50902, 63582, 79372
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2008

Keywords

Examples

			a(10)=2 because 2 binary words of length 10 have at least one subword 10^{7}1 and no subwords 10^{i}1 with i<7: 0100000001, 1000000010.
		

Crossrefs

Cf. A005710, A005711, 7th column of A143291.

Programs

  • Magma
    [n le 9 select 0 else n le 17 select n-9 else 2*Self(n-1)-Self(n-2) +Self(n-8)-Self(n-10)-Self(n-17): n in [1..60]]; // Vincenzo Librandi, Jun 05 2013
  • Maple
    a:= n-> coeff(series(x^9/((x^8+x-1)*(x^9+x-1)), x, n+1), x, n):
    seq(a(n), n=0..60);
  • Mathematica
    CoefficientList[Series[x^9 / ((x^8 + x - 1) (x^9 + x - 1)), {x, 0, 60}], x] (* Vincenzo Librandi, Jun 04 2013 *)

Formula

G.f.: x^9/((x^8+x-1)*(x^9+x-1)).
a(n) = A005710(n+7)-A005711(n+7).
a(n) = 2*a(n-1) - a(n-2) + a(n-8) - a(n-10) - a(n-17). - Vincenzo Librandi, Jun 05 2013
Showing 1-10 of 13 results. Next