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

A177445 Partial sums of A120562.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 10, 13, 14, 17, 19, 22, 24, 28, 31, 36, 37, 41, 44, 48, 50, 55, 58, 63, 65, 70, 74, 80, 83, 90, 95
Offset: 0

Views

Author

Gary W. Adamson, May 08 2010

Keywords

Comments

Equals row sums of triangle A177446

Examples

			a(7) = (1 + 1 + 1 + 2 + 1 + 2 + 2) = 10, where A120562 = (1, 1, 1, 2, 1, 2, 2,...).
		

Crossrefs

Formula

Partial sums of A120562 = SUM_{0..n} A120562(n).

A177446 Triangle read by rows: A000012 * A177444 * the diagonalized variant of A120562.

Original entry on oeis.org

1, 2, 0, 2, 1, 0, 3, 2, 0, 0, 3, 2, 1, 0, 0, 3, 3, 2, 0, 0, 0, 3, 3, 2, 2, 0, 0, 0, 3, 3, 3, 4, 0, 0, 0, 0, 3, 3, 3, 4, 1, 0, 0, 0, 0, 3, 3, 3, 6, 2, 0, 0, 0, 0, 0, 3, 3, 3, 6, 2, 2, 0, 0, 0, 0, 0, 3, 3, 3, 6, 3, 4, 0, 0, 0, 0, 0, 0, 3, 3, 3, 6, 3, 4, 2, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Gary W. Adamson, May 08 2010

Keywords

Comments

Row sums = A177445. Rows apparently tend to 3 * A120562 = 3 * (1, 1, 1, 2, 1, 2, 2, 3, 1, 3, ...).

Examples

			First few rows of the triangle =
1;
2, 0;
2, 1, 0;
3, 2, 0, 0;
3, 2, 1, 0, 0;
3, 3, 2, 0, 0, 0;
3, 3, 2, 2, 0, 0, 0;
3, 3, 3, 4, 0, 0, 0, 0;
3, 3, 3, 4, 1, 0, 0, 0, 0;
3, 3, 3, 6, 2, 0, 0, 0, 0, 0;
3, 3, 3, 6, 2, 2, 0, 0, 0, 0, 0;
3, 3, 3, 6, 3, 4, 0, 0, 0, 0, 0, 0;
3, 3, 3, 6, 3, 4, 2, 0, 0, 0, 0, 0, 0;
3, 3, 3, 6, 3, 6, 4, 0, 0, 0, 0, 0, 0, 0;
3, 3, 3, 6, 3, 6, 4, 3, 0, 0, 0, 0, 0, 0, 0;
...
		

Crossrefs

Formula

Triangle read by rows, M*Q*R; such that M = an infinite lower triangular matrix with all 1's, Q = triangle A177444, and R = the diagonalized variant of A120562 (A120562 in the diagonal and the rest zeros).

Extensions

Definition corrected by Georg Fischer, May 31 2023

A000930 Narayana's cows sequence: a(0) = a(1) = a(2) = 1; thereafter a(n) = a(n-1) + a(n-3).

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88, 129, 189, 277, 406, 595, 872, 1278, 1873, 2745, 4023, 5896, 8641, 12664, 18560, 27201, 39865, 58425, 85626, 125491, 183916, 269542, 395033, 578949, 848491, 1243524, 1822473, 2670964, 3914488, 5736961, 8407925
Offset: 0

Views

Author

Keywords

Comments

Named after a 14th-century Indian mathematician. [The sequence first appeared in the book "Ganita Kaumudi" (1356) by the Indian mathematician Narayana Pandita (c. 1340 - c. 1400). - Amiram Eldar, Apr 15 2021]
Number of compositions of n into parts 1 and 3. - Joerg Arndt, Jun 25 2011
A Lamé sequence of higher order.
Could have begun 1,0,0,1,1,1,2,3,4,6,9,... (A078012) but that would spoil many nice properties.
Number of tilings of a 3 X n rectangle with straight trominoes.
Number of ways to arrange n-1 tatami mats in a 2 X (n-1) room such that no 4 meet at a point. For example, there are 6 ways to cover a 2 X 5 room, described by 11111, 2111, 1211, 1121, 1112, 212.
Equivalently, number of compositions (ordered partitions) of n-1 into parts 1 and 2 with no two 2's adjacent. E.g., there are 6 such ways to partition 5, namely 11111, 2111, 1211, 1121, 1112, 212, so a(6) = 6. [Minor edit by Keyang Li, Oct 10 2020]
This comment covers a family of sequences which satisfy a recurrence of the form a(n) = a(n-1) + a(n-m), with a(n) = 1 for n = 0...m-1. The generating function is 1/(1-x-x^m). Also a(n) = Sum_{i=0..floor(n/m)} binomial(n-(m-1)*i, i). This family of binomial summations or recurrences gives the number of ways to cover (without overlapping) a linear lattice of n sites with molecules that are m sites wide. Special case: m=1: A000079; m=4: A003269; m=5: A003520; m=6: A005708; m=7: A005709; m=8: A005710.
a(n+2) is the number of n-bit 0-1 sequences that avoid both 00 and 010. - David Callan, Mar 25 2004 [This can easily be proved by the Cluster Method - see for example the Noonan-Zeilberger article. - N. J. A. Sloane, Aug 29 2013]
a(n-4) is the number of n-bit sequences that start and end with 0 but avoid both 00 and 010. For n >= 6, such a sequence necessarily starts 011 and ends 110; deleting these 6 bits is a bijection to the preceding item. - David Callan, Mar 25 2004
Also number of compositions of n+1 into parts congruent to 1 mod m. Here m=3, A003269 for m=4, etc. - Vladeta Jovovic, Feb 09 2005
Row sums of Riordan array (1/(1-x^3), x/(1-x^3)). - Paul Barry, Feb 25 2005
Row sums of Riordan array (1,x(1+x^2)). - Paul Barry, Jan 12 2006
Starting with offset 1 = row sums of triangle A145580. - Gary W. Adamson, Oct 13 2008
Number of digits in A061582. - Dmitry Kamenetsky, Jan 17 2009
From Jon Perry, Nov 15 2010: (Start)
The family a(n) = a(n-1) + a(n-m) with a(n)=1 for n=0..m-1 can be generated by considering the sums (A102547):
1 1 1 1 1 1 1 1 1 1 1 1 1
1 2 3 4 5 6 7 8 9 10
1 3 6 10 15 21 28
1 4 10 20
1
------------------------------
1 1 1 2 3 4 6 9 13 19 28 41 60
with (in this case 3) leading zeros added to each row.
(End)
Number of pairs of rabbits existing at period n generated by 1 pair. All pairs become fertile after 3 periods and generate thereafter a new pair at all following periods. - Carmine Suriano, Mar 20 2011
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=3, 2*a(n-3) equals the number of 2-colored compositions of n with all parts >= 3, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
For n>=2, row sums of Pascal's triangle (A007318) with triplicated diagonals. - Vladimir Shevelev, Apr 12 2012
Pisano period lengths of the sequence read mod m, m >= 1: 1, 7, 8, 14, 31, 56, 57, 28, 24, 217, 60, 56, 168, ... (A271953) If m=3, for example, the remainder sequence becomes 1, 1, 1, 2, 0, 1, 0, 0, 1, 1, 1, 2, 0, 1, 0, 0, 1, 1, 1, 2, 0, 1, 0, 0, 1, 1, 1, 2, 0, 1, 0, 0, 1, 1, ... with a period of length 8. - R. J. Mathar, Oct 18 2012
Diagonal sums of triangle A011973. - John Molokach, Jul 06 2013
"In how many ways can a kangaroo jump through all points of the integer interval [1,n+1] starting at 1 and ending at n+1, while making hops that are restricted to {-1,1,2}? (The OGF is the rational function 1/(1 - z - z^3) corresponding to A000930.)" [Flajolet and Sedgewick, p. 373] - N. J. A. Sloane, Aug 29 2013
a(n) is the number of length n binary words in which the length of every maximal run of consecutive 0's is a multiple of 3. a(5) = 4 because we have: 00011, 10001, 11000, 11111. - Geoffrey Critzer, Jan 07 2014
a(n) is the top left entry of the n-th power of the 3X3 matrix [1, 0, 1; 1, 0, 0; 0, 1, 0] or of the 3 X 3 matrix [1, 1, 0; 0, 0, 1; 1, 0, 0]. - R. J. Mathar, Feb 03 2014
a(n-3) is the top left entry of the n-th power of any of the 3 X 3 matrices [0, 1, 0; 0, 1, 1; 1, 0, 0], [0, 0, 1; 1, 1, 0; 0, 1, 0], [0, 1, 0; 0, 0, 1; 1, 0, 1] or [0, 0, 1; 1, 0, 0; 0, 1, 1]. - R. J. Mathar, Feb 03 2014
Counts closed walks of length (n+3) on a unidirectional triangle, containing a loop at one of remaining vertices. - David Neil McGrath, Sep 15 2014
a(n+2) equals the number of binary words of length n, having at least two zeros between every two successive ones. - Milan Janjic, Feb 07 2015
a(n+1)/a(n) tends to x = 1.465571... (decimal expansion given in A092526) in the limit n -> infinity. This is the real solution of x^3 - x^2 -1 = 0. See also the formula by Benoit Cloitre, Nov 30 2002. - Wolfdieter Lang, Apr 24 2015
a(n+2) equals the number of subsets of {1,2,..,n} in which any two elements differ by at least 3. - Robert FERREOL, Feb 17 2016
Let T* be the infinite tree with root 0 generated by these rules: if p is in T*, then p+1 is in T* and x*p is in T*. Let g(n) be the set of nodes in the n-th generation, so that g(0) = {0}, g(1) = {1}, g(2) = {2,x}, g(3) = {3,2x,x+1,x^2}, etc. Let T(r) be the tree obtained by substituting r for x. If a positive integer N such that r = N^(1/3) is not an integer, then the number of (not necessarily distinct) integers in g(n) is A000930(n), for n >= 1. (See A274142.) - Clark Kimberling, Jun 13 2016
a(n-3) is the number of compositions of n excluding 1 and 2, n >= 3. - Gregory L. Simay, Jul 12 2016
Antidiagonal sums of array A277627. - Paul Curtz, May 16 2019
a(n+1) is the number of multus bitstrings of length n with no runs of 3 ones. - Steven Finch, Mar 25 2020
Suppose we have a(n) samples, exactly one of which is positive. Assume the cost for testing a mix of k samples is 3 if one of the samples is positive (but you will not know which sample was positive if you test more than 1) and 1 if none of the samples is positive. Then the cheapest strategy for finding the positive sample is to have a(n-3) undergo the first test and then continue with testing either a(n-4) if none were positive or with a(n-6) otherwise. The total cost of the tests will be n. - Ruediger Jehn, Dec 24 2020

Examples

			The number of compositions of 11 without any 1's and 2's is a(11-3) = a(8) = 13. The compositions are (11), (8,3), (3,8), (7,4), (4,7), (6,5), (5,6), (5,3,3), (3,5,3), (3,3,5), (4,4,3), (4,3,4), (3,4,4). - _Gregory L. Simay_, Jul 12 2016
The compositions from the above example may be mapped to the a(8) compositions of 8 into 1's and 3's using this (more generally applicable) method: replace all numbers greater than 3 with a 3 followed by 1's to make the same total, then remove the initial 3 from the composition. Maintaining the example's order, they become (1,1,1,1,1,1,1,1), (1,1,1,1,1,3), (3,1,1,1,1,1), (1,1,1,1,3,1), (1,3,1,1,1,1), (1,1,1,3,1,1), (1,1,3,1,1,1), (1,1,3,3), (3,1,1,3), (3,3,1,1), (1,3,1,3), (1,3,3,1), (3,1,3,1). - _Peter Munn_, May 31 2017
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A., 2003, id. 8,80.
  • R. K. Guy, "Anyone for Twopins?" in D. A. Klarner, editor, The Mathematical Gardner. Prindle, Weber and Schmidt, Boston, 1981, pp. 2-15. [See p. 12, line 3]
  • H. Langman, Play Mathematics. Hafner, NY, 1962, p. 13.
  • David Sankoff and Lani Haque, Power Boosts for Cluster Tests, in Comparative Genomics, Lecture Notes in Computer Science, Volume 3678/2005, Springer-Verlag. - N. J. A. Sloane, Jul 09 2009
  • 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

For Lamé sequences of orders 1 through 9 see A000045, this sequence, and A017898 - A017904.
Essentially the same as A068921 and A078012.
See also A001609, A145580, A179070, A214551 (same rule except divide by GCD).
A271901 and A271953 give the period of this sequence mod n.
A120562 has the same recurrence for odd n.

Programs

  • GAP
    a:=[1,1,1];; for n in [4..50] do a[n]:=a[n-1]+a[n-3]; od; a; # Muniru A Asiru, Aug 13 2018
    
  • Haskell
    a000930 n = a000930_list !! n
    a000930_list = 1 : 1 : 1 : zipWith (+) a000930_list (drop 2 a000930_list)
    -- Reinhard Zumkeller, Sep 25 2011
    
  • Magma
    [1,1] cat [ n le 3 select n else Self(n-1)+Self(n-3): n in [1..50] ]; // Vincenzo Librandi, Apr 25 2015
    
  • Maple
    f := proc(r) local t1,i; t1 := []; for i from 1 to r do t1 := [op(t1),0]; od: for i from 1 to r+1 do t1 := [op(t1),1]; od: for i from 2*r+2 to 50 do t1 := [op(t1),t1[i-1]+t1[i-1-r]]; od: t1; end; # set r = order
    with(combstruct): SeqSetU := [S, {S=Sequence(U), U=Set(Z, card > 2)}, unlabeled]: seq(count(SeqSetU, size=j), j=3..40); # Zerinvary Lajos, Oct 10 2006
    A000930 := proc(n)
        add(binomial(n-2*k,k),k=0..floor(n/3)) ;
    end proc: # Zerinvary Lajos, Apr 03 2007
    a:= n-> (<<1|1|0>, <0|0|1>, <1|0|0>>^n)[1,1]:
    seq(a(n), n=0..50); # Alois P. Heinz, Jun 20 2008
  • Mathematica
    a[0] = 1; a[1] = a[2] = 1; a[n_] := a[n] = a[n - 1] + a[n - 3]; Table[ a[n], {n, 0, 40} ]
    CoefficientList[Series[1/(1 - x - x^3), {x, 0, 45}], x] (* Zerinvary Lajos, Mar 22 2007 *)
    LinearRecurrence[{1, 0, 1}, {1, 1, 1}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
    a[n_] := HypergeometricPFQ[{(1 - n)/3, (2 - n)/3, -n/3}, {(1 - n)/ 2, -n/2}, -27/4]; Table[a[n], {n, 0, 43}] (* Jean-François Alcover, Feb 26 2013 *)
    Table[-RootSum[1 + #^2 - #^3 &, 3 #^(n + 2) - 11 #^(n + 3) + 2 #^(n + 4) &]/31, {n, 20}] (* Eric W. Weisstein, Feb 14 2025 *)
  • Maxima
    makelist(sum(binomial(n-2*k,k),k,0,n/3),n,0,18); /* Emanuele Munarini, May 24 2011 */
    
  • PARI
    a(n)=polcoeff(exp(sum(m=1,n,((1+sqrt(1+4*x))^m + (1-sqrt(1+4*x))^m)*(x/2)^m/m)+x*O(x^n)),n) \\ Paul D. Hanna, Oct 08 2009
    
  • PARI
    x='x+O('x^66); Vec(1/(1-(x+x^3))) \\ Joerg Arndt, May 24 2011
    
  • PARI
    a(n)=([0,1,0;0,0,1;1,0,1]^n*[1;1;1])[1,1] \\ Charles R Greathouse IV, Feb 26 2017
    
  • Python
    from itertools import islice
    def A000930_gen(): # generator of terms
        blist = [1]*3
        while True:
            yield blist[0]
            blist = blist[1:]+[blist[0]+blist[2]]
    A000930_list = list(islice(A000930_gen(),30)) # Chai Wah Wu, Feb 04 2022
    
  • SageMath
    @CachedFunction
    def a(n): # A000930
        if (n<3): return 1
        else: return a(n-1) + a(n-3)
    [a(n) for n in (0..80)] # G. C. Greubel, Jul 29 2022

Formula

G.f.: 1/(1-x-x^3). - Simon Plouffe in his 1992 dissertation
a(n) = Sum_{i=0..floor(n/3)} binomial(n-2*i, i).
a(n) = a(n-2) + a(n-3) + a(n-4) for n>3.
a(n) = floor(d*c^n + 1/2) where c is the real root of x^3-x^2-1 and d is the real root of 31*x^3-31*x^2+9*x-1 (c = 1.465571... = A092526 and d = 0.611491991950812...). - Benoit Cloitre, Nov 30 2002
a(n) = Sum_{k=0..n} binomial(floor((n+2k-2)/3), k). - Paul Barry, Jul 06 2004
a(n) = Sum_{k=0..n} binomial(k, floor((n-k)/2))(1+(-1)^(n-k))/2. - Paul Barry, Jan 12 2006
a(n) = Sum_{k=0..n} binomial((n+2k)/3,(n-k)/3)*(2*cos(2*Pi*(n-k)/3)+1)/3. - Paul Barry, Dec 15 2006
a(n) = term (1,1) in matrix [1,1,0; 0,0,1; 1,0,0]^n. - Alois P. Heinz, Jun 20 2008
G.f.: exp( Sum_{n>=1} ((1+sqrt(1+4*x))^n + (1-sqrt(1+4*x))^n)*(x/2)^n/n ).
Logarithmic derivative equals A001609. - Paul D. Hanna, Oct 08 2009
a(n) = a(n-1) + a(n-2) - a(n-5) for n>4. - Paul Weisenhorn, Oct 28 2011
For n >= 2, a(2*n-1) = a(2*n-2)+a(2*n-4); a(2*n) = a(2*n-1)+a(2*n-3). - Vladimir Shevelev, Apr 12 2012
INVERT transform of (1,0,0,1,0,0,1,0,0,1,...) = (1, 1, 1, 2, 3, 4, 6, ...); but INVERT transform of (1,0,1,0,0,0,...) = (1, 1, 2, 3, 4, 6, ...). - Gary W. Adamson, Jul 05 2012
G.f.: 1/(G(0)-x) where G(k) = 1 - x^2/(1 - x^2/(x^2 - 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 16 2012
G.f.: 1 + x/(G(0)-x) where G(k) = 1 - x^2*(2*k^2 + 3*k +2) + x^2*(k+1)^2*(1 - x^2*(k^2 + 3*k +2))/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 27 2012
a(2*n) = A002478(n), a(2*n+1) = A141015(n+1), a(3*n) = A052544(n), a(3*n+1) = A124820(n), a(3*n+2) = A052529(n+1). - Johannes W. Meijer, Jul 21 2013, corrected by Greg Dresden, Jul 06 2020
G.f.: Q(0)/2, where Q(k) = 1 + 1/(1 - x*(4*k+1 + x^2)/( x*(4*k+3 + x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
a(n) = v1*w1^n+v3*w2^n+v2*w3^n, where v1,2,3 are the roots of (-1+9*x-31*x^2+31*x^3): [v1=0.6114919920, v2=0.1942540040 - 0.1225496913*I, v3=conjugate(v2)] and w1,2,3 are the roots of (-1-x^2+x^3): [w1=1.4655712319, w2=-0.2327856159 - 0.7925519925*I, w3=conjugate(w2)]. - Gerry Martens, Jun 27 2015
a(n) = (6*A001609(n+3) + A001609(n-7))/31 for n>=7. - Areebah Mahdia, Jun 07 2020
a(n+6)^2 + a(n+1)^2 + a(n)^2 = a(n+5)^2 + a(n+4)^2 + 3*a(n+3)^2 + a(n+2)^2. - Greg Dresden, Jul 07 2021
a(n) = Sum_{i=(n-7)..(n-1)} a(i) / 2. - Jules Beauchamp, May 10 2025

Extensions

Name expanded by N. J. A. Sloane, Sep 07 2012

A047999 Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 2.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

Restored the alternative spelling of Sierpinski to facilitate searching for this triangle using regular-expression matching commands in ASCII. - N. J. A. Sloane, Jan 18 2016
Also triangle giving successive states of cellular automaton generated by "Rule 60" and "Rule 102". - Hans Havermann, May 26 2002
Also triangle formed by reading triangle of Eulerian numbers (A008292) mod 2. - Philippe Deléham, Oct 02 2003
Self-inverse when regarded as an infinite lower triangular matrix over GF(2).
Start with [1], repeatedly apply the map 0 -> [00/00], 1 -> [10/11] [Allouche and Berthe]
Also triangle formed by reading triangles A011117, A028338, A039757, A059438, A085881, A086646, A086872, A087903, A104219 mod 2. - Philippe Deléham, Jun 18 2005
J. H. Conway writes (in Math Forum): at least the first 31 rows give odd-sided constructible polygons (sides 1, 3, 5, 15, 17, ... see A001317). The 1's form a Sierpiński sieve. - M. Dauchez (mdzzdm(AT)yahoo.fr), Sep 19 2005
When regarded as an infinite lower triangular matrix, its inverse is a (-1,0,1)-matrix with zeros undisturbed and the nonzero entries in every column form the Prouhet-Thue-Morse sequence (1,-1,-1,1,-1,1,1,-1,...) A010060 (up to relabeling). - David Callan, Oct 27 2006
Triangle read by rows: antidiagonals of an array formed by successive iterates of running sums mod 2, beginning with (1, 1, 1, ...). - Gary W. Adamson, Jul 10 2008
T(n,k) = A057427(A143333(n,k)). - Reinhard Zumkeller, Oct 24 2010
The triangle sums, see A180662 for their definitions, link Sierpiński’s triangle A047999 with seven sequences, see the crossrefs. The Kn1y(n) and Kn2y(n), y >= 1, triangle sums lead to the Sierpiński-Stern triangle A191372. - Johannes W. Meijer, Jun 05 2011
Used to compute the total Steifel-Whitney cohomology class of the Real Projective space. This was an essential component of the proof that there are no product operations without zero divisors on R^n for n not equal to 1, 2, 4 or 8 (real numbers, complex numbers, quaternions, Cayley numbers), proved by Bott and Milnor. - Marcus Jaiclin, Feb 07 2012
T(n,k) = A134636(n,k) mod 2. - Reinhard Zumkeller, Nov 23 2012
T(n,k) = 1 - A219463(n,k), 0 <= k <= n. - Reinhard Zumkeller, Nov 30 2012
From Vladimir Shevelev, Dec 31 2013: (Start)
Also table of coefficients of polynomials s_n(x) of degree n which are defined by formula s_n(x) = Sum_{i=0..n} (binomial(n,i) mod 2)*x^k. These polynomials we naturally call Sierpiński's polynomials. They also are defined by the recursion: s_0(x)=1, s_(2*n+1)(x) = (x+1)*s_n(x^2), n>=0, and s_(2*n)(x) = s_n(x^2), n>=1.
Note that: s_n(1) = A001316(n),
s_n(2) = A001317(n),
s_n(3) = A100307(n),
s_n(4) = A001317(2*n),
s_n(5) = A100308(n),
s_n(6) = A100309(n),
s_n(7) = A100310(n),
s_n(8) = A100311(n),
s_n(9) = A100307(2*n),
s_n(10) = A006943(n),
s_n(16) = A001317(4*n),
s_n(25) = A100308(2*n), etc.
The equality s_n(10) = A006943(n) means that sequence A047999 is obtained from A006943 by the separation by commas of the digits of its terms. (End)
Comment from N. J. A. Sloane, Jan 18 2016: (Start)
Take a diamond-shaped region with edge length n from the top of the triangle, and rotate it by 45 degrees to get a square S_n. Here is S_6:
[1, 1, 1, 1, 1, 1]
[1, 0, 1, 0, 1, 0]
[1, 1, 0, 0, 1, 1]
[1, 0, 0, 0, 1, 0]
[1, 1, 1, 1, 0, 0]
[1, 0, 1, 0, 0, 0].
Then (i) S_n contains no square (parallel to the axes) with all four corners equal to 1 (cf. A227133); (ii) S_n can be constructed by using the greedy algorithm with the constraint that there is no square with that property; and (iii) S_n contains A064194(n) 1's. Thus A064194(n) is a lower bound on A227133(n). (End)
See A123098 for a multiplicative encoding of the rows, i.e., product of the primes selected by nonzero terms; e.g., 1 0 1 => 2^1 * 3^0 * 5^1. - M. F. Hasler, Sep 18 2016
From Valentin Bakoev, Jul 11 2020: (Start)
The Sierpinski's triangle with 2^n rows is a part of a lower triangular matrix M_n of dimension 2^n X 2^n. M_n is a block matrix defined recursively: M_1= [1, 0], [1, 1], and for n>1, M_n = [M_(n-1), O_(n-1)], [M_(n-1), M_(n-1)], where M_(n-1) is a block matrix of the same type, but of dimension 2^(n-1) X 2^(n-1), and O_(n-1) is the zero matrix of dimension 2^(n-1) X 2^(n-1). Here is how M_1, M_2 and M_3 look like:
1 0 1 0 0 0 1 0 0 0 0 0 0 0
1 1 1 1 0 0 1 1 0 0 0 0 0 0 - It is seen the self-similarity of the
1 0 1 0 1 0 1 0 0 0 0 0 matrices M_1, M_2, ..., M_n, ...,
1 1 1 1 1 1 1 1 0 0 0 0 analogously to the Sierpinski's fractal.
1 0 0 0 1 0 0 0
1 1 0 0 1 1 0 0
1 0 1 0 1 0 1 0
1 1 1 1 1 1 1 1
M_n can also be defined as M_n = M_1 X M_(n-1) where X denotes the Kronecker product. M_n is an important matrix in coding theory, cryptography, Boolean algebra, monotone Boolean functions, etc. It is a transformation matrix used in computing the algebraic normal form of Boolean functions. Some properties and links concerning M_n can be seen in LINKS. (End)
Sierpinski's gasket has fractal (Hausdorff) dimension log(A000217(2))/log(2) = log(3)/log(2) = 1.58496... (and cf. A020857). This gasket is the first of a family of gaskets formed by taking the Pascal triangle (A007318) mod j, j >= 2 (see CROSSREFS). For prime j, the dimension of the gasket is log(A000217(j))/log(j) = log(j(j + 1)/2)/log(j) (see Reiter and Bondarenko references). - Richard L. Ollerton, Dec 14 2021

Examples

			Triangle begins:
              1,
             1,1,
            1,0,1,
           1,1,1,1,
          1,0,0,0,1,
         1,1,0,0,1,1,
        1,0,1,0,1,0,1,
       1,1,1,1,1,1,1,1,
      1,0,0,0,0,0,0,0,1,
     1,1,0,0,0,0,0,0,1,1,
    1,0,1,0,0,0,0,0,1,0,1,
   1,1,1,1,0,0,0,0,1,1,1,1,
  1,0,0,0,1,0,0,0,1,0,0,0,1,
  ...
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • Brand, Neal; Das, Sajal; Jacob, Tom. The number of nonzero entries in recursively defined tables modulo primes. Proceedings of the Twenty-first Southeastern Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1990). Congr. Numer. 78 (1990), 47--59. MR1140469 (92h:05004).
  • John W. Milnor and James D. Stasheff, Characteristic Classes, Princeton University Press, 1974, pp. 43-49 (sequence appears on p. 46).
  • H.-O. Peitgen, H. Juergens and D. Saupe: Chaos and Fractals (Springer-Verlag 1992), p. 408.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: (this sequence) (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930(m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).
Other versions: A090971, A038183.
From Johannes W. Meijer, Jun 05 2011: (Start)
A106344 is a skew version of this triangle.
Triangle sums (see the comments): A001316 (Row1; Related to Row2), A002487 (Related to Kn11, Kn12, Kn13, Kn21, Kn22, Kn23), A007306 (Kn3, Kn4), A060632 (Fi1, Fi2), A120562 (Ca1, Ca2), A112970 (Gi1, Gi2), A127830 (Ze3, Ze4). (End)

Programs

  • Haskell
    import Data.Bits (xor)
    a047999 :: Int -> Int -> Int
    a047999 n k = a047999_tabl !! n !! k
    a047999_row n = a047999_tabl !! n
    a047999_tabl = iterate (\row -> zipWith xor ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Dec 11 2011, Oct 24 2010
    
  • Magma
    A047999:= func< n,k | BitwiseAnd(n-k, k) eq 0 select 1 else 0 >;
    [A047999(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 03 2024
  • Maple
    # Maple code for first M rows (here M=10) - N. J. A. Sloane, Feb 03 2016
    ST:=[1,1,1]; a:=1; b:=2; M:=10;
    for n from 2 to M do ST:=[op(ST),1];
    for i from a to b-1 do ST:=[op(ST), (ST[i+1]+ST[i+2]) mod 2 ]; od:
    ST:=[op(ST),1];
    a:=a+n; b:=a+n; od:
    ST; # N. J. A. Sloane
    # alternative
    A047999 := proc(n,k)
        modp(binomial(n,k),2) ;
    end proc:
    seq(seq(A047999(n,k),k=0..n),n=0..12) ; # R. J. Mathar, May 06 2016
  • Mathematica
    Mod[ Flatten[ NestList[ Prepend[ #, 0] + Append[ #, 0] &, {1}, 13]], 2] (* Robert G. Wilson v, May 26 2004 *)
    rows = 14; ca = CellularAutomaton[60, {{1}, 0}, rows-1]; Flatten[ Table[ca[[k, 1 ;; k]], {k, 1, rows}]] (* Jean-François Alcover, May 24 2012 *)
    Mod[#,2]&/@Flatten[Table[Binomial[n,k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Jun 26 2019 *)
  • PARI
    \\ Recurrence for Pascal's triangle mod p, here p = 2.
    p = 2; s=13; T=matrix(s,s); T[1,1]=1;
    for(n=2,s, T[n,1]=1; for(k=2,n, T[n,k] = (T[n-1,k-1] + T[n-1,k])%p ));
    for(n=1,s,for(k=1,n,print1(T[n,k],", "))) \\ Gerald McGarvey, Oct 10 2009
    
  • PARI
    A011371(n)=my(s);while(n>>=1,s+=n);s
    T(n,k)=A011371(n)==A011371(k)+A011371(n-k) \\ Charles R Greathouse IV, Aug 09 2013
    
  • PARI
    T(n,k)=bitand(n-k,k)==0 \\ Charles R Greathouse IV, Aug 11 2016
    
  • Python
    def A047999_T(n,k):
        return int(not ~n & k) # Chai Wah Wu, Feb 09 2016
    

Formula

Lucas's Theorem is that T(n,k) = 1 if and only if the 1's in the binary expansion of k are a subset of the 1's in the binary expansion of n; or equivalently, k AND NOT n is zero, where AND and NOT are bitwise operators. - Chai Wah Wu, Feb 09 2016 and N. J. A. Sloane, Feb 10 2016
Sum_{k>=0} T(n, k) = A001316(n) = 2^A000120(n).
T(n,k) = T(n-1,k-1) XOR T(n-1,k), 0 < k < n; T(n,0) = T(n,n) = 1. - Reinhard Zumkeller, Dec 13 2009
T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod 2 = |T(n-1,k-1) - T(n-1,k)|, 0 < k < n; T(n,0) = T(n,n) = 1. - Rick L. Shepherd, Feb 23 2018
From Vladimir Shevelev, Dec 31 2013: (Start)
For polynomial {s_n(x)} we have
s_0(x)=1; for n>=1, s_n(x) = Product_{i=1..A000120(n)} (x^(2^k_i) + 1),
if the binary expansion of n is n = Sum_{i=1..A000120(n)} 2^k_i;
G.f. Sum_{n>=0} s_n(x)*z^n = Product_{k>=0} (1 + (x^(2^k)+1)*z^(2^k)) (0
Let x>1, t>0 be real numbers. Then
Sum_{n>=0} 1/s_n(x)^t = Product_{k>=0} (1 + 1/(x^(2^k)+1)^t);
Sum_{n>=0} (-1)^A000120(n)/s_n(x)^t = Product_{k>=0} (1 - 1/(x^(2^k)+1)^t).
In particular, for t=1, x>1, we have
Sum_{n>=0} (-1)^A000120(n)/s_n(x) = 1 - 1/x. (End)
From Valentin Bakoev, Jul 11 2020: (Start)
(See my comment about the matrix M_n.) Denote by T(i,j) the number in the i-th row and j-th column of M_n (0 <= i, j < 2^n). When i>=j, T(i,j) is the j-th number in the i-th row of the Sierpinski's triangle. For given i and j, we denote by k the largest integer of the type k=2^m and k
T(i,0) = T(i,i) = 1, or
T(i,j) = 0 if i < j, or
T(i,j) = T(i-k,j), if j < k, or
T(i,j) = T(i-k,j-k), if j >= k.
Thus, for given i and j, T(i,j) can be computed in O(log_2(i)) steps. (End)

Extensions

Additional links from Lekraj Beedassy, Jan 22 2004

A008620 Positive integers repeated three times.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26
Offset: 0

Keywords

Comments

Arises from Gleason's theorem on self-dual codes: the Molien series is 1/((1-x^8)*(1-x^24)) for the weight enumerators of doubly-even binary self-dual codes; also 1/((1-x^4)*(1-x^12)) for ternary self-dual codes.
The number of partitions of n into distinct parts where each part is either a power of two or three times a power of two.
Number of partitions of n into parts 1 or 3. - Reinhard Zumkeller, Aug 15 2011
The dimension of the space of modular forms on Gamma_1(3) of weight n>0 with a(q) the generator of weight 1 and c(q)^3 / 27 the generator of weight 3 where a(), c() are cubic AGM theta functions. - Michael Somos, Apr 01 2015
Cubic AGM theta functions: a(q) (see A004016), b(q) (A005928), c(q) (A005882).
a(n-1) is the minimal number of circles that can be drawn through n points in general position in the plane. - Anton Zakharov, Dec 31 2016
Number of partitions of n into distinct parts from A029744.- R. J. Mathar, Mar 01 2023
Number of representations n=sum_i c_i*2^i with c_i in {0,1,3,4} [Anders]. See A120562 or A309025 for other c_i sets. - R. J. Mathar, Mar 01 2023

References

  • G. E. Andrews, K. Eriksson, Integer Partitions, Cambridge Univ. Press, 2004. page 12 Exer. 7
  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 100.
  • F. J. MacWilliams and N. J. A. Sloane, Theory of Error-Correcting Codes, 1977, Chapter 19, Eq. (14), p. 601 and Theorem 3c, p. 602; also Problem 5 p. 620.

Programs

  • Haskell
    a008620 = (+ 1) . (`div` 3)
    a008620_list = concatMap (replicate 3) [1..]
    -- Reinhard Zumkeller, Feb 19 2013, Apr 16 2012, Sep 25 2011
    
  • Magma
    [Floor(n/3)+1: n in [0..80]]; // Vincenzo Librandi, Aug 16 2011
    
  • Magma
    a := func< n | Dimension( ModularForms( Gamma1(3), n))>; /* Michael Somos, Apr 01 2015 */
  • Maple
    A008620:=n->floor(n/3)+1; seq(A008620(n), n=0..100); # Wesley Ivan Hurt, Dec 06 2013
  • Mathematica
    Table[Floor[n/3] + 1, {n, 0, 90}] (* Stefan Steinerberger, Apr 02 2006 *)
    Table[{n, n, n}, {n, 30}] // Flatten (* Harvey P. Dale, Jan 15 2017 *)
    Ceiling[Range[20]/3] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[Ceiling[n/3], {n, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[(1 + n - Cos[2 n Pi/3] + Sin[2 n Pi/3]/Sqrt[3])/3, {n, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[(n - ChebyshevU[n, -1/2] + 1)/3, {n, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    LinearRecurrence[{1, 0, 1, -1}, {1, 1, 1, 2}, 20] (* Eric W. Weisstein, Aug 12 2023 *)
    CoefficientList[Series[1/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Aug 12 2023 *)
  • PARI
    a(n)=n\3+1
    
  • Sage
    def a(n) : return( dimension_modular_forms( Gamma1(3), n) ); # Michael Somos, Apr 01 2015
    

Formula

a(n) = floor(n/3) + 1.
a(n) = A010766(n+3, 3).
G.f.: 1/((1-x)*(1-x^3)) = 1/((1-x)^2*(1+x+x^2)).
a(n) = A001840(n+1) - A001840(n). - Reinhard Zumkeller, Aug 01 2002
From Paul Barry, May 19 2004: (Start)
Convolution of A049347 and A000027.
a(n) = Sum_{k=0..n} (k+1)*2*sqrt(3)*cos(2*Pi*(n-k)/3 + Pi/6)/3. (End)
The g.f. is 1/(1-V_trefoil(x)), where V_trefoil is the Jones polynomial of the trefoil knot. - Paul Barry, Oct 08 2004
a(2n) = A004396(n+1). - Philippe Deléham, Dec 14 2006
a(n) = ceiling(n/3), n>=1. - Mohammad K. Azarian, May 22 2007
E.g.f.: exp(x)*(2 + x)/3 + exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))/9. - Stefano Spezia, Oct 17 2022

A112970 A generalized Stern sequence.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 4, 2, 2, 1, 5, 3, 3, 2, 5, 2, 3, 1, 6, 4, 3, 2, 6, 2, 3, 1, 7, 5, 4, 3, 8, 3, 5, 2, 8, 5, 4, 2, 8, 3, 3, 1, 9, 6, 5, 4, 9, 3, 6, 2, 9, 6, 4, 2, 9, 3, 3, 1, 10, 7, 6, 5, 11, 4, 8, 3, 12, 8, 6, 3, 13, 5, 5, 2, 13, 8, 7, 5, 12, 4, 7, 2, 12, 8, 5, 3, 11, 3, 4, 1, 12, 9, 7, 6
Offset: 0

Author

Paul Barry, Oct 07 2005

Keywords

Comments

Conjectures: a(2^n)=a(2^(n+1)+1)=A033638(n); a(2^n-1)=a(3*2^n-1)=1.
The Gi1 and Gi2 triangle sums, see A180662 for their definitions, of Sierpinski's triangle A047999 equal this sequence. The Gi1 and Gi2 sums can also be interpreted as (i + 4*j = n) and (4*i + j = n) sums, see the Northshield reference. Some A112970(2^n-p) sequences, 0<=p<=32, lead to known sequences, see the crossrefs. - Johannes W. Meijer, Jun 05 2011

Crossrefs

Cf. A120562 (Northshield).
Cf. A033638 (p=0), A000012 (p=1), A004526 (p=2, p=3, p=5, p=9, p=17), A002620 (p=4, p=7, p=13, p=25), A000027 (p=6, p=11, p=21), A004116 (p=8, p=15, p=29), A035106 (p=10, p=19), A024206 (p=14, p=27), A007494 (p=18), A014616 (p=22), A179207 (p=26). - Johannes W. Meijer, Jun 05 2011

Programs

  • Maple
    A112970:=proc(n) option remember; if n <0 then A112970(n):=0 fi: if (n=0 or n=1) then 1 elif n mod 2 = 0 then A112970(n/2) + A112970((n/2)-2) else A112970((n-1)/2); fi; end: seq(A112970(n),n=0..99); # Johannes W. Meijer, Jun 05 2011
  • Mathematica
    a[n_] := a[n] = Which[n<0, 0, n==0 || n==1, 1, Mod[n, 2]==0, a[n/2] + a[n/2-2], True, a[(n-1)/2]];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Aug 02 2022 *)

Formula

a(n) = Sum_{k=0..n} mod(sum{j=0..n, (-1)^(n-k)*C(j, n-j)*C(k, j-k)}, 2).
From Johannes W. Meijer, Jun 05 2011: (Start)
a(2*n+1) = a(n) and a(2*n) = a(n) + a(n-2) with a(0) = 1, a(1) = 1 and a(n)=0 for n<=-1.
G.f.: Product_{n>=0} (1 + x^(2^n) + x^(4*2^n)). (End)
G.f. A(x) satisfies: A(x) = (1 + x + x^4) * A(x^2). - Ilya Gutkovskiy, Jul 09 2019

A177444 Triangle by columns, (1, 1, 0, 1, 0, 0, 0, ...); shifted down twice for columns > 0.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
Offset: 0

Author

Gary W. Adamson, May 08 2010

Keywords

Comments

Let the triangle = M. Limit_{n->infinity} M^n = A120562, the left-shifted vector
considered as a sequence.

Examples

			First few rows of the triangle:
  1;
  1, 0;
  0, 1, 0;
  1, 1, 0, 0;
  0, 0, 1, 0, 0;
  0, 1, 1, 0, 0, 0;
  0, 0, 0, 1, 0, 0, 0;
  0, 0, 1, 1, 0, 0, 0, 0;
  0, 0, 0, 0, 1, 0, 0, 0, 0;
  0, 0, 0, 1, 1, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0;
  ...
		

Crossrefs

Formula

As an infinite lower triangular matrix, (1, 1, 0, 1, 0, 0, 0, ...) in every
column, prefaced with k zeros.

A191373 Sum of binomial coefficients C(i+j,i) modulo 2 over all pairs (i,j) of positive integers satisfying 5i+j=n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 1, 2, 2, 4, 1, 2, 2, 4, 2, 3, 3, 5, 1, 3, 2, 5, 2, 3, 4, 6, 1, 3, 2, 6, 2, 3, 4, 6, 2, 4, 3, 7, 3, 5, 5, 8, 1, 4, 3, 8, 2, 3, 5, 8, 2, 4, 3, 8, 4, 6, 6, 9, 1, 5, 3, 9, 2, 3, 6, 9, 2, 4, 3, 9
Offset: 0

Author

Johannes W. Meijer, Jun 05 2011

Keywords

Comments

The Le1{1,5} and Le2{5,1} triangle sums of Sierpinski’s triangle A047999 equal this sequence; see the formulas for their definitions. The Le1{1,5} and Le2{5,1} triangle sums are similar to the Kn11 and Kn21 sums, the Ca1 and Ca2 sums, and the Gi1 and Gi2 sums, see A180662.
Some A191373(2^n-p) sequences, 0<=p<=32, lead to known sequences, see the crossrefs.

Crossrefs

Cf. A001316 (1,1), A002487 (2,1), A120562 (3,1), A112970 (4,1), A191373 (5,1)
Cf. A000012 (p=0), A006498 (p=1, p=2, p=4, p=8, p=16, p=32), A070550 (p=3, p=6, p=12, p=24), A000071 (p=15, p=30), A115008 (p=23).

Programs

  • Maple
    A191373:=proc(n) option remember; if n <0 then A191373(n):=0 fi: if (n=0 or n=1) then 1 elif n mod 2 = 0 then A191373(n/2) else A191373((n-1)/2) + A191373(((n-1)/2)-2); fi; end: seq(A191373(n),n=0..75);

Formula

a(2*n) = a(n) and a(2*n+1) = a(n) + a(n-2) with a(0) = 1, a(1) = 1 and a(n)=0 for n<=-1.
a(n) = Le1{1,5}(n) = add(T(n-4*k,k),k=0..floor(n/5))
a(n) = Le1{1,5}(n) = sum(binomial(i + j, i) mod 2 | (i + 5*j) = n)
a(n) = Le2{5,1}(n) = add(T(n-4*k,n-5*k),k=0..floor(n/5))
a(n) = Le2{5,1}(n) = sum(binomial(i + j, i) mod 2 | (5*i + j) = n)
G.f.: Product_{n>=0} (1+x^(2^n)+x^(5*2^n)).
G.f. A(x) satisfies: A(x) = (1 + x + x^5) * A(x^2). - Ilya Gutkovskiy, Jul 09 2019

A214126 a(2n)=a(n-1)+a(n) and a(2n+1)=a(n+1) for n>=1, with a(0)=a(1)=1.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 4, 3, 5, 2, 5, 4, 6, 3, 7, 5, 8, 2, 7, 5, 7, 4, 9, 6, 10, 3, 9, 7, 10, 5, 12, 8, 13, 2, 10, 7, 9, 5, 12, 7, 12, 4, 11, 9, 13, 6, 15, 10, 16, 3, 13, 9, 12, 7, 16, 10, 17, 5, 15, 12, 17, 8, 20, 13, 21, 2, 15, 10, 12, 7, 17, 9, 16, 5, 14, 12
Offset: 0

Author

Alex Ratushnyak, Jul 04 2012

Keywords

Comments

a(2^n) = A000045(n+2), a(2^n-1) = A000045(n+1). - Alois P. Heinz, Jul 06 2012

Examples

			a(2^n+1) = 2 because a(2) = 2 and a(2*n+1) = a(n+1).
		

Crossrefs

Cf. A120562: same formula, seed {0,1}, first term removed.
Cf. A082498: same formula, seed {1,0}, first term removed.
Cf. A214127: same formula, seed {1,2}.
Cf. A000045.

Programs

  • Maple
    a:= proc(n) local r;
          a(n):= `if`(n<2, 1, `if`(irem(n, 2, 'r')=0, a(r-1)+a(r), a(r+1)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 06 2012
  • Mathematica
    a[0] = a[1] = 1;
    a[n_] := a[n] = If[EvenQ[n], a[n/2-1] + a[n/2], a[(n-1)/2+1]];
    Array[a, 100, 0] (* Jean-François Alcover, May 31 2019 *)
  • Python
    a = [1]*(77*2)
    for n in range(1,77):
        a[2*n  ]=a[n-1]+a[n]
        a[2*n+1]=a[n+1]
        print(str(a[n-1]),end=',')

Formula

a(0) = a(1) = 1, for n>=1: a(2*n) = a(n-1)+a(n) and a(2*n+1) = a(n+1).

A309025 Expansion of x * Product_{k>=0} (1 + x^(2^k) + x^(2^(k+3))).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 2, 2, 1, 4, 2, 2, 1, 4, 2, 2, 1, 5, 3, 3, 2, 4, 2, 2, 1, 6, 3, 4, 2, 4, 2, 2, 1, 7, 4, 4, 2, 4, 2, 2, 1, 8, 4, 4, 2, 4, 2, 2, 1, 9, 5, 5, 3, 5, 3, 3, 2, 9, 4, 5, 2, 5, 2, 3, 1, 10, 6, 5, 3, 6, 4, 3, 2, 10, 4, 5, 2, 6, 2, 3, 1, 11, 7, 6, 4
Offset: 0

Author

Ilya Gutkovskiy, Jul 07 2019

Keywords

Comments

a(n+1) is the number of representations of n=sum_i c_i*2^i with c_i in {0,1,8} [Anders]. See A120562 if c_i in {0,1,3} or A000012 if c_i in {0,1}. - R. J. Mathar, Mar 01 2023

Crossrefs

Programs

  • Mathematica
    nmax = 100; CoefficientList[Series[x Product[(1 + x^(2^k) + x^(2^(k + 3))), {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x]

Formula

a(n) = 0 for n <= 0, a(1) = 1; a(2*n) = a(n), a(2*n+1) = a(n-3) + a(n+1).
Showing 1-10 of 12 results. Next