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-6 of 6 results.

A077947 Expansion of 1/(1 - x - x^2 - 2*x^3).

Original entry on oeis.org

1, 1, 2, 5, 9, 18, 37, 73, 146, 293, 585, 1170, 2341, 4681, 9362, 18725, 37449, 74898, 149797, 299593, 599186, 1198373, 2396745, 4793490, 9586981, 19173961, 38347922, 76695845, 153391689, 306783378, 613566757, 1227133513, 2454267026, 4908534053, 9817068105
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Number of sequences of codewords of total length n from the code C={0,10,110,111}. E.g., a(3)=5 corresponds to the sequences 000, 010, 100, 110 and 111. - Paul Barry, Jan 23 2004
In other words: number of compositions of n into 1 kind of 1's and 2's and two kinds of 3's. - Joerg Arndt, Jun 25 2011
Diagonal sums of number Pascal-(1,2,1) triangle A081577. - Paul Barry, Jan 24 2005
For n>0: a(n) = A173593(2*n+1) - A173593(2*n); a(n+1) = A173593(2*n) - A173593(2*n-1). - Reinhard Zumkeller, Feb 22 2010
Sums of 3 successive terms are powers of 2. - Mark Dols, Aug 20 2010
For n > 2, a(n) is the number of quaternary sequences of length n (i) starting with q(0)=0; (ii) ending with q(n-1)=0 or 3 and (iii) in which all triples (q(i), q(i+1), q(i+2)) contain digits 0 and 3; cf. A294627. - Wojciech Florek, Jul 30 2018

Examples

			It is shown in A294627 that there are 42 quaternary sequences (i.e. build from four digits 0, 1, 2, 3) and having both 0 and 3 in every (consecutive) triple. Only a(4) = 9 of them start with 0 and end with 0 or 3: 0030, 0033, 0130, 0230, 0300, 0303, 0310, 0320, 0330. - _Wojciech Florek_, Jul 30 2018
		

References

  • S. Roman, Introduction to Coding and Information Theory, Springer-Verlag, 1996, p. 42

Crossrefs

Apart from signs, same as A077972.
Cf. A139217 and A139218.
Cf. A078010.
Cf. A294627.

Programs

  • Magma
    [Round(2^(n+2)/7): n in [0..40]]; // Vincenzo Librandi, Jun 25 2011
    
  • Maple
    seq(round(2^(n+2)/7),n=0..25); # Mircea Merca, Dec 28 2010
  • Mathematica
    CoefficientList[Series[1/(1 - x - x^2 - 2*x^3), {x, 0, 100}], x] (* or *) LinearRecurrence[{1, 1, 2}, {1, 1, 2}, 70] (* Vladimir Joseph Stephan Orlovsky, Jun 28 2011 *)
  • Maxima
    a(n):=sum(sum(binomial(k,j)*binomial(j,n-3*k+2*j)*2^(k-j),j,0,k),k,1,n); /* Vladimir Kruchinin, Sep 07 2010 */
    
  • PARI
    Vec(1/(1-x-x^2-2*x^3) + O(x^100)) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A077947(n): return (k:=(m:=1<=7) # Chai Wah Wu, Jan 21 2023

Formula

G.f.: 1/((1-2*x)*(1+x+x^2)).
a(n) = a(n-1)+a(n-2)+2*a(n-3). - Paul Curtz, May 23 2008
a(n) = round(2^(n+2)/7). - Mircea Merca, Dec 28 2010
a(n) = 4*2^n/7 + 3*cos(2*Pi*n/3)/7 + sqrt(3)*sin(2*Pi*n/3)/21. - Paul Barry, Jan 23 2004
Convolution of A000079 and A049347. a(n) = Sum_{k=0..n} 2^k*2*sqrt(3)*cos(2*Pi(n-k)/3+Pi/6)/3. - Paul Barry, May 19 2004
a(n) = sum(sum(binomial(k,j)*binomial(j,n-3*k+2*j)*2^(k-j),j,0,k),k,1,n), n>0. - Vladimir Kruchinin, Sep 07 2010
Partial sums of A078010 starting (1, 0, 1, 3, 4, 9, ...). - Gary W. Adamson, May 13 2013
a(n) = (1/14)*(2^(n + 3) + (-1)^n*((-1)^floor(n/3) + 4*(-1)^floor((n + 1)/3) + 2*(-1)^floor((n + 2)/3) + (-1)^floor((n + 4)/3))). - John M. Campbell, Dec 23 2016
a(n) = (1/63)*(9*2^(2 + n) + (-1)^n*(2 + 9*floor(n/6) - 32*floor((n + 5)/6) + 24*floor((n + 7)/6) + 20*floor((n + 8)/6) - 10*floor((n + 9)/6) - 27*floor((n + 10)/6) + 14*floor((n + 11)/6) + 3*floor((n + 13)/6) - 2*floor((n + 14)/6) + floor((n + 15)/6))). - John M. Campbell, Dec 23 2016
7*a(n) = 2^(n+2) + A167373(n+1). - R. J. Mathar, Feb 06 2020
a(n) = T(n+1) + 2*(a(1)*T(n-1) + a(2)*T(n-2) + ... + a(n-2)*T(2) + a(n-1)*T(1)) for T(n) = A000073(n), the tribonacci numbers. - Greg Dresden and Bora Bursalı, Sep 14 2023

Extensions

Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021

A033129 Base-2 digits are, in order, the first n terms of the periodic sequence with initial period [1,1,0].

Original entry on oeis.org

0, 1, 3, 6, 13, 27, 54, 109, 219, 438, 877, 1755, 3510, 7021, 14043, 28086, 56173, 112347, 224694, 449389, 898779, 1797558, 3595117, 7190235, 14380470, 28760941, 57521883, 115043766, 230087533, 460175067, 920350134, 1840700269
Offset: 0

Views

Author

Keywords

Comments

Number of moves to separate a Hanoi Tower into two towers of even resp. odd stones. - Martin von Gagern, May 26 2004
From Reinhard Zumkeller, Feb 22 2010: (Start)
Terms of A173593 with initial digits '11' in binary representation: a(n) = A173593(2*n-3) for n>0;
for n>0: a(3*n-1) = A083713(n);
a(n+1) - a(n) = abs(A078043(n)). (End)

Crossrefs

Cf. A011655 (repeat 0,1,1), A289006 (the same in octal).
Cf. A057744, A294627 (first differences).

Programs

  • Mathematica
    Table[(1/14)*(-9 - 2*(-1)^Floor[(2 n)/3] + (-1)^(1 + Floor[(1/3)*(7 + 2 n)]) + 3*2^(2 + n)), {n, 0, 100}] (* John M. Campbell, Dec 26 2016 *)
    Table[FromDigits[PadRight[{},n,{1,1,0}],2],{n,0,40}] (* Harvey P. Dale, Oct 02 2022 *)
  • PARI
    A033129(n)=3<<(n+1)\7 \\ M. F. Hasler, Jun 23 2017
    
  • Python
    print([(6*2**n//7) for n in range(50)]) # Karl V. Keller, Jr., Jul 11 2022

Formula

From Paul Barry, Jan 23 2004: (Start)
Partial sums of abs(A078043).
G.f.: x*(1+x)/((1-x)*(1-2*x)*(1+x+x^2)) = x*(1+x)/(1-2*x-x^3+2*x^4).
a(n) = (6/7)*2^n - (4/21)*cos(2*Pi*n/3) - (2/21)*sqrt(3)*sin(2*Pi*n/3) - 2/3. (End)
a(n) = a(n-3) + 3 * 2^(n-3). - Martin von Gagern, May 26 2004
a(n+1) = 2*a(n) + 1 - 0^((a(n)+1) mod 4). - Reinhard Zumkeller, Feb 22 2010
a(n) = floor(2^(n+1)*3/7). - Jean-Marie Madiot, Oct 05 2012
a(n) = (1/14)*(-9 - 2*(-1)^floor((2n)/3) + (-1)^(floor((2*n + 7)/3) + 1) + 3*2^(n + 2)). - John M. Campbell, Dec 26 2016

A122552 a(0)=a(1)=a(2)=1, a(n) = a(n-1) + a(n-2) + 2*a(n-3) for n > 2.

Original entry on oeis.org

1, 1, 1, 4, 7, 13, 28, 55, 109, 220, 439, 877, 1756, 3511, 7021, 14044, 28087, 56173, 112348, 224695, 449389, 898780, 1797559, 3595117, 7190236, 14380471, 28760941, 57521884, 115043767, 230087533, 460175068, 920350135, 1840700269, 3681400540
Offset: 0

Views

Author

Philippe Deléham, Sep 20 2006

Keywords

Comments

Equals INVERT transform of (1, 0, 3, 0, 3, 0, 3, ...). - Gary W. Adamson, Apr 27 2009
No term is divisible by 3. - Vladimir Joseph Stephan Orlovsky, Mar 24 2011
For n > 3, a(n) is the number of quaternary sequences of length n-1 starting with q(0) = 0, in which all triples (q(i), q(i+1), q(i+2)) contain digits 0 and 3; cf. A294627. - Wojciech Florek, Jul 30 2018
For n > 0, a(n) is the number of ways to tile a strip of length n with squares, dominoes, and two colors of trominoes, with the restriction that the first tile cannot be a domino. - Greg Dresden and Bora Bursalı, Aug 31 2023

Examples

			It is shown in A294627 that there are 42 quaternary sequences (i.e., build from four digits 0, 1, 2, 3) and having both 0 and 3 in every (consecutive) triple. Only a(5=4+1) = 13 of them start with 0: 003x, 030x, 03y0, 0y30, 0330, where x = 0, 1, 2, 3 and y = 1, 2.
		

Crossrefs

Cf. A294627.

Programs

  • GAP
    a:=[1,1,1];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+2*a[n-3]; od; a; # Muniru A Asiru, Jul 30 2018
  • Maple
    seq(coeff(series((1-x^2)/(1-x-x^2-2*x^3), x,n+1),x,n),n=0..40); # Muniru A Asiru, Aug 02 2018
  • Mathematica
    LinearRecurrence[{1, 1, 2}, {1, 1, 1}, 40]
    CoefficientList[ Series[(x^2 - 1)/(2x^3 + x^2 + x - 1), {x, 0, 35}], x] (* Robert G. Wilson v, Jul 30 2018 *)
  • PARI
    Vec((1-x^2)/(1-x-x^2-2*x^3)+O(x^99)) \\ Charles R Greathouse IV, Jan 17 2012
    
  • Sage
    from sage.combinat.sloane_functions import recur_gen3; it = recur_gen3(1,1,1,1,1,2); [next(it) for i in range(30)] # Zerinvary Lajos, Jun 25 2008
    

Formula

a(3*n) = 2*a(3*n-1)+2, a(3*n+1) = 2*a(3*n)-1, a(3*n+2) = 2*a(3*n+1)-1, a(0)=1.
G.f.: (1-x^2)/(1-x-x^2-2*x^3).
a(n) = ((-1)^n*A130815(n+2) + 3*2^n)/7. - R. J. Mathar, Nov 30 2008
From Paul Curtz, Oct 02 2009: (Start)
a(n) = A140295(n+2)/4.
a(n+1) - 2a(n) = period 3: repeat -1,-1,2 = -A061347.
a(n) - a(n-1) = 0,0,3,3,6,15,27,54,111,... = 3*A077947.
a(n) - a(n-2) = 0,3,6,9,21,42,81,....
a(n) - a(n-3) = 3,6,12,24,... = A007283 = 3*A000079.
a(3n) + a(3n+1) + a(3n+2) = 3,24,192,... = A103333(n+1) = A140295(3n) + A140295(3n+1) + A140295(3n+2).
See A078010, A139217, A139218. (End)

Extensions

Corrected by T. D. Noe, Nov 01 2006, Nov 07 2006
Typo in definition corrected by Paul Curtz, Oct 02 2009

A075092 Sum of generalized tribonacci numbers (A001644) and reflected generalized tribonacci numbers (A073145).

Original entry on oeis.org

6, 0, 2, 12, 6, 20, 50, 56, 134, 264, 402, 836, 1542, 2652, 5154, 9392, 16902, 31824, 58082, 106172, 197126, 360932, 662994, 1223784, 2245766, 4130520, 7606770, 13976436, 25711622, 47310252, 86978370, 160002656, 294324230, 541249952
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Aug 31 2002

Keywords

Comments

Conjecture: a(n) >= 0.
For n > 2, a(n) is the number of cyclic sequences (q1, q2, ..., qn) consisting of zeros, ones and twos such that each triple contains 0 and 1 at least once, provided the positions of the zeros and ones are fixed on a circle. For example, a(5)=20 because only the sequences (00101), (01001), (01010), (01011), (01012), (01021), (01101), (01201), (02101), (20101) and those obtained from them by exchanging 0 and 1 contain 0 and 1 in each triple (including triples q4, q5, q1 and q5, q1, q2). For n = 1, 2 the statement is still true provided we allow the sequence to wrap around itself on a circle. E.g., a(2) = 2 since only sequences 01 and 10 can be wrapped so one obtains (010) and (101), respectively. - Wojciech Florek, Nov 25 2021

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6) ));  // G. C. Greubel, Apr 13 2019
    
  • Mathematica
    CoefficientList[Series[(6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6), {x, 0, 40}], x]
  • PARI
    my(x='x+O('x^40)); Vec((6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6)) \\ G. C. Greubel, Apr 13 2019
    
  • Sage
    ((6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Apr 13 2019

Formula

a(n) = a(n-2) + 4*a(n-3) + a(n-4) - a(n-6), a(0)=6, a(1)=0, a(2)=2, a(3)=12, a(4)=6, a(5)=20.
G.f.: (6 - 4*x^2 - 12*x^3 - 2*x^4)/(1 - x^2 - 4*x^3 - x^4 + x^6).

A057744 Expansion of (1-2*x^3)/(1-2*x-x^3+2*x^4).

Original entry on oeis.org

1, 2, 4, 7, 14, 28, 55, 110, 220, 439, 878, 1756, 3511, 7022, 14044, 28087, 56174, 112348, 224695, 449390, 898780, 1797559, 3595118, 7190236, 14380471, 28760942, 57521884, 115043767, 230087534, 460175068, 920350135, 1840700270, 3681400540
Offset: 0

Views

Author

N. J. A. Sloane, Oct 30 2000

Keywords

Crossrefs

Cf. A033129, A294627 (first differences).

Programs

  • Mathematica
    LinearRecurrence[{2, 0, 1, -2}, {1, 2, 4, 7}, 30] (* Jinyuan Wang, Apr 07 2020 *)
  • PARI
    Vec((1-2*x^3)/(1-2*x-x^3+2*x^4) + O(x^50)) \\ Michel Marcus, Dec 09 2014

Formula

G.f.: (1-2*x^3)/(1-2*x-x^3+2*x^4).
a(0) = 1, a(1) = 2, a(2) = 4, a(3) = 7, a(n) = 2*a(n-1) + a(n-3) - 2*a(n-4) for n > 3. - Jinyuan Wang, Apr 08 2020
a(n) = ceiling((6/7)*2^n) = (6*2^n + 2^(n mod 3))/7. - Kevin Ryde, Aug 25 2021

A349700 Difference between 4*A001590(n+2) and A075092(n).

Original entry on oeis.org

-6, 4, 6, 0, 18, 24, 30, 92, 138, 236, 518, 856, 1570, 3072, 5374, 9972, 18714, 33684, 62406, 115440, 210482, 388776, 715934, 1312460, 2419114, 4449532, 8174406, 15049672, 27675714, 50884368, 93629694, 172187364, 316668474, 582540836, 1071371910, 1970517728
Offset: 0

Views

Author

Wojciech Florek, Nov 25 2021

Keywords

Comments

Tribonacci numbers 4*A001590(n+2) (i.e., tribonacci numbers t(n) = t(n-1) + t(n-2) + t(n-3) with t(0) = 0, t(1) = 4, t(2) = 8) for n > 2 are numbers of ternary sequences (q(1),q(2),...,q(n)), q(i) = 0,1,2, of length n such that all triples (q(i),q(i+1),q(i+2)) contain digits 0 and 1 at least once. In the other words {0,1} is a subset of each {q(i),q(i+1),q(i+2)}. Similarly, A075092(n), for n > 2, presents a number of ternary cyclic sequences with this property. Hence, a(n), for n > 2, gives a number of (ordinary) sequences which do not lead to cyclic sequences with triples (q(n-1),q(n),q(1)) and (q(n),q(1),q(2)) satisfying the above formulated condition. The special cases, n = 1,2, can be included in a way proposed in A001644.
The recurrence formula is the same as this for A075092, with different initial conditions.

Examples

			If n = 4, then there are 24 finite sequences: 0010, 0011, 0012, 0100, 0101, 0102, 0110, 0120, 0210, nine analogous starting with 1, 2010, 2011, 2012, 2100, 2101, and 2102. Only six of them, namely  0011, 0101, 0110, 1001, 1010, 1100, yield cyclic sequences satisfying the restriction imposed. Therefore, a(4) = 24 - 6 = 18.
		

Crossrefs

Programs

  • Mathematica
    nterms=50;LinearRecurrence[{0,1,4,1,0,-1},{-6,4,6,0,18,24},nterms] (* Paolo Xausa, Nov 26 2021 *)

Formula

a(n) = a(n-2) + 4*a(n-3) + a(n-4) - a(n-6), a(0) = -6, a(1) = 4, a(2) = 6, a(3) = 0, a(4) = 18, a(5) = 24.
G.f.: (4*x^5-2*x^4-20*x^3-12*x^2-4*x+6)/(-x^6+x^4+4*x^3+x^2-1).
Showing 1-6 of 6 results.