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

A038754 a(2n) = 3^n, a(2n+1) = 2*3^n.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.
Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - Gary W. Adamson, May 15 2010
The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - Johannes W. Meijer, May 29 2010
a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - Vladimir Shevelev, May 16 2012
A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - Vladimir Shevelev, May 21 2012
Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - R. J. Mathar, Aug 10 2012
Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - Eric M. Schmidt, Jul 31 2013
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, Jun 05 2014
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 1. - Sean A. Irvine, Jun 03 2025

Examples

			In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a038754 n = a038754_list !! n
    a038754_list = concat $ transpose [a000244_list, a008776_list]
    -- Reinhard Zumkeller, Oct 19 2015
    
  • Magma
    [n le 2 select n else 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 18 2016
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # Zerinvary Lajos, Mar 20 2008
    with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{0,3},{1,2},40] (* Harvey P. Dale, Jan 26 2014 *)
    CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 18 2016 *)
    Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)
    
  • PARI
    a(n)=3^(n>>1)<
    				
  • SageMath
    [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.
a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.
From Benoit Cloitre, Apr 27 2003: (Start)
a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.
a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).
a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).
a(2*n+1) = a(2*n) + a(2*n-1). (End)
G.f.: (1+2*x)/(1-3*x^2). - Paul Barry, Aug 25 2003
From Reinhard Zumkeller, Sep 11 2003: (Start)
a(n) = (1 + n mod 2) * 3^floor(n/2).
a(n) = A087503(n) - A087503(n-1). (End)
a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - Paul Barry, Sep 16 2003
From Reinhard Zumkeller, May 26 2008: (Start)
a(n) = A140740(n+2,2).
a(n+1) = a(n) + a(n - n mod 2). (End)
If p(i) = Fibonacci(i-3) and if A is the Hessenberg matrix of order n defined by A(i,j) = p(j-i+1), (i<=j), A(i,j)=-1, (i=j+1), and A(i,j)=0 otherwise. Then, for n>=1, a(n-1) = (-1)^n det A. - Milan Janjic, May 08 2010
a(n) = A182751(n) for n >= 2. - Jaroslav Krizek, Nov 27 2010
a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - Vladimir Shevelev, May 16 2012
a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - Vladimir Shevelev, May 21 2012
Sum_(n>=0) 1/a(n) = 9/4. - Alexander R. Povolotsky, Aug 24 2012
a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - Richard R. Forberg, Sep 04 2013
a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Aug 11 2014
From Reinhard Zumkeller, Oct 19 2015: (Start)
a(2*n) = A000244(n), a(2*n+1) = A008776(n).
For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)
E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - Stefano Spezia, Feb 17 2022
Sum_{n>=0} (-1)^n/a(n) = 3/4. - Amiram Eldar, Dec 02 2022

A033484 a(n) = 3*2^n - 2.

Original entry on oeis.org

1, 4, 10, 22, 46, 94, 190, 382, 766, 1534, 3070, 6142, 12286, 24574, 49150, 98302, 196606, 393214, 786430, 1572862, 3145726, 6291454, 12582910, 25165822, 50331646, 100663294, 201326590, 402653182, 805306366, 1610612734, 3221225470
Offset: 0

Views

Author

Keywords

Comments

Number of nodes in rooted tree of height n in which every node (including the root) has valency 3.
Pascal diamond numbers: reflect Pascal's n-th triangle vertically and sum all elements. E.g., a(3)=1+(1+1)+(1+2+1)+(1+1)+1. - Paul Barry, Jun 23 2003
Number of 2 X n binary matrices avoiding simultaneously the right-angled numbered polyomino patterns (ranpp) (00;1), (10;0) and (11;0). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2 and j1 < j2 and these elements are in the same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Binomial and inverse binomial transform are in A001047 (shifted) and A122553. - R. J. Mathar, Sep 02 2008
a(n) = (Sum_{k=0..n-1} a(n)) + (2*n + 1); e.g., a(3) = 22 = (1 + 4 + 10) + 7. - Gary W. Adamson, Jan 21 2009
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if either 0) x is a proper subset of y or y is a proper subset of x and x and y are disjoint, or 1) x equals y. Then a(n) = |R|. - Ross La Haye, Mar 19 2009
Equals the Jacobsthal sequence A001045 convolved with (1, 3, 4, 4, 4, 4, 4, ...). - Gary W. Adamson, May 24 2009
Equals the eigensequence of a triangle with the odd integers as the left border and the rest 1's. - Gary W. Adamson, Jul 24 2010
An elephant sequence, see A175655. For the central square four A[5] vectors, with decimal values 58, 154, 178 and 184, lead to this sequence. For the corner squares these vectors lead to the companion sequence A097813. - Johannes W. Meijer, Aug 15 2010
a(n+2) is the integer with bit string "10" * "1"^n * "10".
a(n) = A027383(2n). - Jason Kimberley, Nov 03 2011
a(n) = A153893(n)-1 = A083416(2n+1). - Philippe Deléham, Apr 14 2013
a(n) = A082560(n+1,A000079(n)) = A232642(n+1,A128588(n+1)). - Reinhard Zumkeller, May 14 2015
a(n) is the sum of the entries in the n-th and (n+1)-st rows of Pascal's triangle minus 2. - Stuart E Anderson, Aug 27 2017
Also the number of independent vertex sets and vertex covers in the complete tripartite graph K_{n,n,n}. - Eric W. Weisstein, Sep 21 2017
Apparently, a(n) is the least k such that the binary expansion of A000045(k) ends with exactly n+1 ones. - Rémy Sigrist, Sep 25 2021
a(n) is the number of root ancestral configurations for a pair consisting of a matching gene tree and species tree with the modified lodgepole shape and n+1 cherry nodes. - Noah A Rosenberg, Jan 16 2025

Examples

			Binary: 1, 100, 1010, 10110, 101110, 1011110, 10111110, 101111110, 1011111110, 10111111110, 101111111110, 1011111111110, 10111111111110,
G.f. = 1 + 4*x + 10*x^2 + 22*x^3 + 46*x^4 + 94*x^5 + 190*x^6 + 382*x^7 + ...
		

References

  • J. Riordan, Series-parallel realization of the sum modulo 2 of n switching variables, in Claude Elwood Shannon: Collected Papers, edited by N. J. A. Sloane and A. D. Wyner, IEEE Press, NY, 1993, pp. 877-878.

Crossrefs

Programs

  • GAP
    List([0..35], n-> 3*2^n -2); # G. C. Greubel, Nov 18 2019
  • Haskell
    a033484 = (subtract 2) . (* 3) . (2 ^)
    a033484_list = iterate ((subtract 2) . (* 2) . (+ 2)) 1
    -- Reinhard Zumkeller, Apr 23 2013
    
  • Magma
    [3*2^n-2: n in [1..36]]; // Vincenzo Librandi, Nov 22 2010
    
  • Maple
    with(combinat):a:=n->stirling2(n,2)+stirling2(n+1,2): seq(a(n), n=1..35); # Zerinvary Lajos, Oct 07 2007
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=(a[n-1]+1)*2 od: seq(a[n], n=1..35); # Zerinvary Lajos, Feb 22 2008
  • Mathematica
    Table[3 2^n - 2, {n, 0, 35}] (* Vladimir Joseph Stephan Orlovsky, Dec 16 2008 *)
    (* Start from Eric W. Weisstein, Sep 21 2017 *)
    3*2^Range[0, 35] - 2
    LinearRecurrence[{3, -2}, {1, 4}, 36]
    CoefficientList[Series[(1+x)/(1-3x+2x^2), {x, 0, 35}], x] (* End *)
  • PARI
    a(n) = 3<Charles R Greathouse IV, Nov 02 2011
    
  • Sage
    [3*2^n -2 for n in (0..35)] # G. C. Greubel, Nov 18 2019
    

Formula

G.f.: (1+x)/(1-3*x+2*x^2).
a(n) = 2*(a(n-1) + 1) for n>0, with a(0)=1.
a(n) = A007283(n) - 2.
G.f. is equivalent to (1-2*x-3*x^2)/((1-x)*(1-2*x)*(1-3*x)). - Paul Barry, Apr 28 2004
From Reinhard Zumkeller, Oct 09 2004: (Start)
A099257(a(n)) = A099258(a(n)) = a(n).
a(n) = 2*A055010(n) = (A068156(n) - 1)/2. (End)
Row sums of triangle A130452. - Gary W. Adamson, May 26 2007
Row sums of triangle A131110. - Gary W. Adamson, Jun 15 2007
Binomial transform of (1, 3, 3, 3, ...). - Gary W. Adamson, Oct 17 2007
Row sums of triangle A051597 (a triangle generated from Pascal's rule given right and left borders = 1, 2, 3, ...). - Gary W. Adamson, Nov 04 2007
Equals A132776 * [1/1, 1/2, 1/3, ...]. - Gary W. Adamson, Nov 16 2007
a(n) = Sum_{k=0..n} A112468(n,k)*3^k. - Philippe Deléham, Feb 23 2014
a(n) = -(2^n) * A036563(1-n) for all n in Z. - Michael Somos, Jul 04 2017
E.g.f.: 3*exp(2*x) - 2*exp(x). - G. C. Greubel, Nov 18 2019

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

Original entry on oeis.org

1, 2, 4, 6, 9, 13, 18, 25, 34, 46, 62, 83, 111, 148, 197, 262, 348, 462, 613, 813, 1078, 1429, 1894, 2510, 3326, 4407, 5839, 7736, 10249, 13578, 17988, 23830, 31569, 41821, 55402, 73393, 97226, 128798, 170622, 226027, 299423, 396652, 525453, 696078, 922108
Offset: 1

Views

Author

Ed Pegg Jr, Oct 16 2010

Keywords

Comments

Number of wins in Penney's game if the two players start HHT and TTT and HHT beats TTT.
HHT beats TTT 70% of the time. - Geoffrey Critzer, Mar 01 2014

Examples

			a(n) enumerates length n+2 sequences on {H,T} that end in HHT but do not contain the contiguous subsequence TTT.
a(3)=4 because we have: TTHHT, THHHT, HTHHT, HHHHT.
a(4)=6 because we have: TTHHHT, THTHHT, THHHHT, HTTHHT, HTHHHT, HHHHHT. - _Geoffrey Critzer_, Mar 01 2014
		

Crossrefs

Related sequences are A000045 (HHH beats HHT, HTT beats TTH), A006498 (HHH beats HTH), A023434 (HHH beats HTT), A000930 (HHH beats THT, HTH beats HHT), A000931 (HHH beats TTH), A077868 (HHT beats HTH), A002620 (HHT beats HTT), A000012 (HHT beats THH), A004277 (HHT beats THT), A070550 (HTH beats HHH), A000027 (HTH beats HTT), A097333 (HTH beats THH), A040000 (HTH beats TTH), A068921 (HTH beats TTT), A054405 (HTT beats HHH), A008619 (HTT beats HHT), A038718 (HTT beats THT), A128588 (HTT beats TTT).
Cf. A164315 (essentially the same sequence).

Programs

  • Maple
    A171861 := proc(n) option remember; if n <=4 then op(n,[1,2,4,6]); else procname(n-1)+procname(n-2)-procname(n-4) ; end if; end proc:
  • Mathematica
    nn=44;CoefficientList[Series[x(1+x+x^2)/(1-x-x^2+x^4),{x,0,nn}],x] (* Geoffrey Critzer, Mar 01 2014 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,0,1,1]^(n-1)*[1;2;4;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016

Formula

a(n) = a(n-1) +a(n-2) -a(n-4) = A000931(n+10)-3 = A134816(n+6)-3 = A078027(n+12)-3.
a(n) = A164315(n-1). - Alois P. Heinz, Oct 12 2017

A303696 Number A(n,k) of binary words of length n with k times as many occurrences of subword 101 as occurrences of subword 010; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 4, 7, 1, 2, 4, 6, 12, 1, 2, 4, 6, 12, 21, 1, 2, 4, 6, 10, 20, 37, 1, 2, 4, 6, 10, 17, 38, 65, 1, 2, 4, 6, 10, 16, 28, 66, 114, 1, 2, 4, 6, 10, 16, 26, 49, 124, 200, 1, 2, 4, 6, 10, 16, 26, 42, 84, 224, 351, 1, 2, 4, 6, 10, 16, 26, 42, 70, 148, 424, 616
Offset: 0

Views

Author

Alois P. Heinz, Apr 28 2018

Keywords

Comments

A(n,n) is the number of binary words of length n avoiding both subwords 101 and 010. A(4,4) = 10: 0000, 0001, 0011, 0110, 0111, 1000, 1001, 1100, 1110, 1111.

Examples

			Square array A(n,k) begins:
    1,   1,   1,   1,   1,   1,   1, ...
    2,   2,   2,   2,   2,   2,   2, ...
    4,   4,   4,   4,   4,   4,   4, ...
    7,   6,   6,   6,   6,   6,   6, ...
   12,  12,  10,  10,  10,  10,  10, ...
   21,  20,  17,  16,  16,  16,  16, ...
   37,  38,  28,  26,  26,  26,  26, ...
   65,  66,  49,  42,  42,  42,  42, ...
  114, 124,  84,  70,  68,  68,  68, ...
  200, 224, 148, 116, 110, 110, 110, ...
  351, 424, 263, 196, 178, 178, 178, ...
		

Crossrefs

Columns k=0-3 give: A005251(n+3), A164146, A303430, A307795.
Main diagonal gives A128588(n+1).

Programs

  • Maple
    b:= proc(n, t, h, c, k) option remember; `if`(abs(c)>k*n, 0,
         `if`(n=0, 1, b(n-1, [1, 3, 1][t], 2, c-`if`(h=3, k, 0), k)
                    + b(n-1, 2, [1, 3, 1][h], c+`if`(t=3, 1, 0), k)))
        end:
    A:= (n, k)-> b(n, 1$2, 0, min(k, n)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, t_, h_, c_, k_] := b[n, t, h, c, k] = If[Abs[c] > k n, 0, If[n == 0, 1, b[n - 1, {1, 3, 1}[[t]], 2, c - If[h == 3, k, 0], k] + b[n - 1, 2, {1, 3, 1}[[h]], c + If[t == 3, 1, 0], k]]];
    A[n_, k_] := b[n, 1, 1, 0, Min[k, n]];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Mar 20 2020, from Maple *)

Formula

ceiling(A(n,n)/2) = A000045(n+1).

A212829 T(n,k)=Number of 0..k arrays of length n with no adjacent pair equal to its immediately preceding adjacent pair, and new values introduced in 0..k order.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 5, 6, 1, 2, 5, 12, 10, 1, 2, 5, 13, 33, 16, 1, 2, 5, 13, 43, 90, 26, 1, 2, 5, 13, 44, 152, 246, 42, 1, 2, 5, 13, 44, 167, 559, 672, 68, 1, 2, 5, 13, 44, 168, 695, 2091, 1836, 110, 1, 2, 5, 13, 44, 168, 716, 3070, 7882, 5016, 178, 1, 2, 5, 13, 44, 168, 717
Offset: 1

Views

Author

R. H. Hardin May 28 2012

Keywords

Comments

Table starts
...1.....1......1.......1.......1.......1.......1.......1.......1.......1
...2.....2......2.......2.......2.......2.......2.......2.......2.......2
...4.....5......5.......5.......5.......5.......5.......5.......5.......5
...6....12.....13......13......13......13......13......13......13......13
..10....33.....43......44......44......44......44......44......44......44
..16....90....152.....167.....168.....168.....168.....168.....168.....168
..26...246....559.....695.....716.....717.....717.....717.....717.....717
..42...672...2091....3070....3331....3359....3360....3360....3360....3360
..68..1836...7882...14074...16599...17055...17091...17092...17092...17092
.110..5016..29809...65958...87059...92749...93492...93537...93538...93538
.178.13704.112895..313098..473569..534071..545670..546817..546872..546873
.288.37440.427824.1497216.2641428.3220152.3372738.3394616.3396312.3396378

Examples

			Some solutions for n=8 k=4
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..0....1....1....1....1....1....0....1....1....1....0....1....1....1....1....1
..1....2....2....2....2....1....1....2....2....2....0....2....2....0....2....0
..0....3....3....2....1....0....2....3....1....0....1....3....1....2....3....2
..0....4....3....1....3....2....3....1....0....1....2....0....0....1....4....2
..1....3....2....1....4....0....1....3....3....3....0....2....0....0....0....2
..2....3....1....3....2....1....0....2....3....4....1....2....3....0....0....3
..1....1....4....0....0....2....3....4....1....1....0....2....4....3....4....3
		

Crossrefs

Column 1 is A128588

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +a(n-2) for n>3
k=2: a(n) = 2*a(n-1) +2*a(n-2) for n>5
k=3: a(n) = 4*a(n-1) +a(n-2) -6*a(n-3) -3*a(n-4) for n>7
k=4: a(n) = 7*a(n-1) -7*a(n-2) -20*a(n-3) +10*a(n-4) +24*a(n-5) +8*a(n-6) for n>9
k=5: a(n) = 11*a(n-1) -30*a(n-2) -21*a(n-3) +112*a(n-4) +63*a(n-5) -119*a(n-6) -120*a(n-7) -30*a(n-8) for n>11

A078678 Number of binary strings with n 1's and n 0's avoiding zigzags, that is avoiding the substrings 101 and 010.

Original entry on oeis.org

1, 2, 4, 8, 18, 42, 100, 242, 592, 1460, 3624, 9042, 22656, 56970, 143688, 363348, 920886, 2338566, 5949148, 15157874, 38674978, 98803052, 252701484, 646990518, 1658066668, 4252908542, 10917422860, 28046438252, 72099983802, 185469011130, 477383400300
Offset: 0

Views

Author

Emanuele Munarini, Dec 17 2002

Keywords

Comments

Also number of Grand Dyck paths of length 2*n with no zigzags, that is, with no factors UDU or DUD. - Emanuele Munarini, Jul 07 2011

Examples

			For n = 2 : 0011, 0110, 1001, 1100.
For n = 3 : 000111, 011001, 100011, 110001, 001110, 011100, 100110, 111000.
		

Crossrefs

Cf. A003440.
Main diagonal of array A099172.
Related to diagonal of rational functions: A268545-A268555.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [1, 2, 4, 8, 18][n+1],
         (2*n*a(n-1)+(n-2)*a(n-2)+(2*n-8)*a(n-3)-(n-4)*a(n-4))/n)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 13 2020
  • Mathematica
    Table[SeriesCoefficient[Series[Sqrt[(1 + x + x^2)/(1 - 3 x + x^2)], {x, 0, n}], n], {n, 0, 40}]
  • Maxima
    a(n):=coeff(taylor((1+x+x^2)/sqrt(1-2*x-x^2-2*x^3+x^4),x,0,n),x,n);
    makelist(a(n),n,0,12); /* Emanuele Munarini, Jul 07 2011 */
    
  • PARI
    my(x='x+O('x^99)); Vec(((1+x+x^2)/(1-3*x+x^2))^(1/2)) \\ Altug Alkan, Jul 18 2016

Formula

G.f.: sqrt( ( 1 + x + x^2 ) / ( 1 - 3*x + x^2 ) ).
a(n) = Sum_{k=0..n+floor(n/2)} binomial( n - k + 2*floor(k/3), floor(k/3) )^2.
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)^2*( 2*n^2 - 6*n*k + 6*k^2 )/(n-k)^2, n > 0.
a(n) ~ 2 * ((3+sqrt(5))/2)^n / (5^(1/4)*sqrt(Pi*n)). - Vaclav Kotesovec, Mar 21 2014
a(n) = [x^n y^n](1+x*y+x^2*y^2)/(1-x-y+x*y-x^2*y^2). - Gheorghe Coserea, Jul 18 2016
D-finite with recurrence: n*a(n) -2*n*a(n-1) +(-n+2)*a(n-2) +2*(-n+4)*a(n-3) +(n-4)*a(n-4)=0. [Doslic] - R. J. Mathar, Jun 21 2018

A232642 Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 2 are in S, and duplicates are deleted as they occur.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 8, 7, 14, 12, 11, 22, 9, 18, 16, 15, 30, 13, 26, 24, 23, 46, 20, 19, 38, 17, 34, 32, 31, 62, 28, 27, 54, 25, 50, 48, 47, 94, 21, 42, 40, 39, 78, 36, 35, 70, 33, 66, 64, 63, 126, 29, 58, 56, 55, 110, 52, 51, 102, 49, 98, 96, 95, 190, 44
Offset: 1

Views

Author

Clark Kimberling, Nov 28 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 2 are in S. Then S is the set of positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2,4), g(3) = (3,6,5,10), etc. Concatenating these gives A232642, a permutation of the positive integers. For n > 1, the number of numbers in g(n) is 2*F(n+1), where F = A000045, the Fibonacci numbers. It is helpful to show the results as a tree with the terms of S as nodes, an edge from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x + 2 if 2*x + 2 has not already occurred.
Seen as triangle read by rows: A082560 with duplicates removed. - Reinhard Zumkeller, May 14 2015

Examples

			Each x begets x + 1 and 2*x + 2, but if either has already occurred it is deleted. Thus, 1 begets 2 and 4; then 2 begets 3 and 6, and 4 begets 5 and 10, so that g(3) = (3,6,5,10).
First 5 generations, also showing the places where duplicates were removed:
.  1:                                1
.  2:                2                               4
.  3:        3              6               5                10
.  4:    _       8      7       14      _       12       11       22
.  5:  _  __   9  18  _  16  15   30  _  __  13   26  __   24  23   46
These are the corresponding complete rows of triangle A082560:
.  1:                                1
.  2:                2                               4
.  3:        3              6               5                10
.  4:    4       8      7       14      6       12       11       22
.  5:  5  10   9  18  8  16  15   30  7  14  13   26  12   24  23   46
		

Crossrefs

Cf. A128588 (row lengths), A033484 (right edges), A257956 (row sums), A082560.

Programs

  • Haskell
    import Data.List.Ordered (member); import Data.List (sort)
    a232642 n k = a232642_tabf !! (n-1) !! (k-1)
    a232642_row n = a232642_tabf !! (n-1)
    a232642_tabf = f a082560_tabf [] where
       f (xs:xss) zs = ys : f xss (sort (ys ++ zs)) where
         ys = [v | v <- xs, not $ member v zs]
    a232642_list = concat a232642_tabf
    -- Reinhard Zumkeller, May 14 2015
  • Mathematica
    z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] + 2]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232642 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A000045 *)
    Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232643 *)

Extensions

Keyword tabf added, to bring out function g, by Reinhard Zumkeller, May 14 2015

A163733 Number of n X 2 binary arrays with all 1's connected, all corners 1, and no 1 having more than two 1's adjacent.

Original entry on oeis.org

1, 1, 2, 2, 4, 6, 10, 16, 26, 42, 68, 110, 178, 288, 466, 754, 1220, 1974, 3194, 5168, 8362, 13530, 21892, 35422, 57314, 92736, 150050, 242786, 392836, 635622, 1028458, 1664080, 2692538, 4356618, 7049156, 11405774, 18454930, 29860704, 48315634, 78176338
Offset: 1

Views

Author

R. H. Hardin, Aug 03 2009

Keywords

Comments

Same recurrence for A163695.
Same recurrence for A163714.
Appears to coincide with diagonal sums of A072405. - Paul Barry, Aug 10 2009
From Gary W. Adamson, Sep 15 2016: (Start)
Let the sequence prefaced with a 1: (1, 1, 1, 2, 2, 4, 6, ...) equate to r(x). Then (r(x) * r(x^2) * r(x^4) * r(x^8) * ...) = the Fibonacci sequence, (1, 1, 2, 3, 5, ...). Let M = the following production matrix:
1, 0, 0, 0, 0, ...
1, 0, 0, 0, 0, ...
1, 1, 0, 0, 0, ...
2, 1, 0, 0, 0, ...
2, 1, 1, 0, 0, ...
4, 2, 1, 0, 0, ...
6, 2, 1, 1, 0, ...
...
Limit of the matrix power M^k as k->infinity results in a single column vector equal to the Fibonacci sequence. (End)
Apparently a(n) = A128588(n-2) for n > 3. - Georg Fischer, Oct 14 2018

Examples

			All solutions for n=8:
   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1
   0 1   1 0   1 0   1 0   1 0   1 0   0 1   0 1   0 1   0 1
   0 1   1 0   1 0   1 0   1 1   1 0   0 1   0 1   1 1   0 1
   0 1   1 0   1 0   1 1   0 1   1 0   0 1   0 1   1 0   1 1
   0 1   1 0   1 1   0 1   0 1   1 0   0 1   1 1   1 0   1 0
   0 1   1 0   0 1   0 1   0 1   1 1   1 1   1 0   1 0   1 0
   0 1   1 0   0 1   0 1   0 1   0 1   1 0   1 0   1 0   1 0
   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1
------
   1 1   1 1   1 1   1 1   1 1   1 1
   0 1   0 1   0 1   1 0   1 0   1 0
   1 1   1 1   0 1   1 0   1 1   1 1
   1 0   1 0   1 1   1 1   0 1   0 1
   1 1   1 0   1 0   0 1   0 1   1 1
   0 1   1 1   1 1   1 1   1 1   1 0
   0 1   0 1   0 1   1 0   1 0   1 0
   1 1   1 1   1 1   1 1   1 1   1 1
		

Crossrefs

Programs

Formula

Empirical: a(n) = a(n-1) + a(n-2) for n >= 5.
G.f.: (1-x^3)/(1-x-x^2) (conjecture). - Paul Barry, Aug 10 2009
a(n) = round(phi^(k-1)) - round(phi^(k-1)/sqrt(5)), phi = (1 + sqrt(5))/2 (conjecture). - Federico Provvedi, Mar 26 2013
G.f.: 1 + 2*x - x*Q(0), where Q(k) = 1 + x^2 - (2*k+1)*x + x*(2*k-1 - x)/Q(k+1); (conjecture), (continued fraction). - Sergei N. Gladkovskii, Oct 05 2013
G.f.: If prefaced with a 1, (1, 1, 1, 2, 2, 4, ...): (1 - x^2 - x^4)/(1 - x - x^2); where the modified sequence satisfies A(x)/A(x^2), A(x) is the Fibonacci sequence. - Gary W. Adamson, Sep 15 2016

A111961 Expansion of 1/(sqrt(1-2x-3x^2)-x).

Original entry on oeis.org

1, 2, 6, 18, 56, 176, 558, 1778, 5686, 18230, 58558, 188366, 606588, 1955044, 6305418, 20347342, 65689088, 212146400, 685342218, 2214556478, 7157409064, 23136645472, 74801223162, 241863933094, 782131232390, 2529458676326
Offset: 0

Views

Author

Paul Barry, Aug 23 2005

Keywords

Comments

Row sums of A111960.
A transform of the Fibonacci numbers. - Paul Barry, Sep 23 2005
Apparently the Motzkin transform of (0 followed by A128588). - R. J. Mathar, Dec 11 2008
Inverse binomial transform of A026671. - Philippe Deléham, Feb 11 2009
Hankel transform is 2^n. - Paul Barry, Mar 02 2010

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[1/(Sqrt[1-2*x-3*x^2]-x), {x, 0, 20}], x] (* Vaclav Kotesovec, Feb 08 2014 *)

Formula

a(n) = Sum_{k=0..n} Sum_{j=0..n} C(n, j)*C((j-1)/2, (j-k)/2)*2^(j-k)*(1+(-1)^(j-k))/2.
a(n) = Sum_{k=0..n} F(k+1)*Sum_{i=0..floor((n-k)/2)} C(n, i)*C(n-i, i+k)/(i+k+1). - Paul Barry, Sep 23 2005
G.f.: M(x)^2/(2*M(x)-M(x)^2), where M(x) is the g.f. of the Motzkin numbers A001006. - Paul Barry, Feb 03 2006
G.f.: 1/(1-2x/(1-x/(1-x^2/(1-x/(1-x/91-x^2/(1-x/(1-x/(1-x^2/(1-... (continued fraction). - Paul Barry, Mar 02 2010
D-finite with recurrence: n*a(n) + (-4*n+3)*a(n-1) + 3*(-n+1)*a(n-2) + 2*(7*n-15)*a(n-3) + 12*(n-3)*a(n-4) = 0. - R. J. Mathar, Nov 15 2012
a(n) ~ (1+sqrt(5))^n / sqrt(5). - Vaclav Kotesovec, Feb 08 2014

A128587 Row sums of A128586.

Original entry on oeis.org

1, 1, 1, -1, 3, -5, 9, -15, 25, -41, 67, -109, 177, -287, 465, -753, 1219, -1973, 3193, -5167, 8361, -13529, 21891, -35421, 57313, -92735, 150049, -242785, 392835, -635621, 1028457, -1664079, 2692537, -4356617, 7049155, -11405773, 18454929
Offset: 1

Views

Author

Gary W. Adamson, Mar 11 2007

Keywords

Comments

Binomial transform of A128587 = A128588: (1, 2, 4, 6, 10, 16, 26, ...).

Examples

			a(5) = 3 = ( -3, 8, 0, -7, 5).
		

Crossrefs

This is a signed version of A001595. - Franklin T. Adams-Watters, Sep 30 2009
Cf. A000045.

Programs

  • GAP
    List([1..40], n-> (-1)^(n-1)*(2*Fibonacci(n-2)-1)); # G. C. Greubel, Jul 10 2019
  • Magma
    [(-1)^(n-1)*(2*Fibonacci(n-2)-1): n in [1..40]]; // G. C. Greubel, Jul 10 2019
    
  • Mathematica
    Table[(-1)^(n-1)*(2*Fibonacci[n-2] -1), {n, 40}] (* G. C. Greubel, Jul 10 2019 *)
  • PARI
    vector(40, n, f=fibonacci; (-1)^(n-1)*(2*f(n-2)-1)) \\ G. C. Greubel, Jul 10 2019
    
  • Sage
    [(-1)^(n-1)*(2*fibonacci(n-2)-1) for n in (1..40)] # G. C. Greubel, Jul 10 2019
    

Formula

Row sums of triangle A128586, inverse binomial transform of A128588.
From R. J. Mathar, Jun 03 2009: (Start)
a(n) = -2*a(n-1) + a(n-3) = (-1)^n*(1 - A118658(n-1)).
G.f.: x*(1+3*x+3*x^2)/((1+x)*(1+x-x^2)). (End)
a(n+3) = (-1)^n * A001595(n) for all n>=0. - M. F. Hasler and Franklin T. Adams-Watters, Sep 30 2009
a(n) = (-1)^(n-1)*(2*Fibonacci(n-2) - 1). - G. C. Greubel, Jul 10 2019

Extensions

More terms from R. J. Mathar, Jun 03 2009
Duplicate of a formula removed by R. J. Mathar, Oct 23 2009
Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021
Showing 1-10 of 17 results. Next