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.

Previous Showing 11-20 of 28 results. Next

A094705 Convolution of Jacobsthal(n) and 3^n.

Original entry on oeis.org

0, 1, 4, 15, 50, 161, 504, 1555, 4750, 14421, 43604, 131495, 395850, 1190281, 3576304, 10739835, 32241350, 96767741, 290390604, 871346575, 2614389250, 7843866801, 23532998504, 70601791715, 211810967550, 635444087461, 1906354632004, 5719108635255, 17157415384250
Offset: 0

Views

Author

Paul Barry, May 21 2004

Keywords

Comments

For k>2, a(n,k)=k^(n+1)/((k-2)(k+1))-2^(n+1)/(3k-6)-(-1)^n/(3k+3) gives the convolution of Jacobsthal(n) and k^n.
In general x/((1-ax)(1-ax-bx^2)) expands to Sum_{k=0..floor(n/2)} C(n-k,k+1)a^(n-k-1)*(b/a)^k. - Paul Barry, Oct 25 2004

Crossrefs

Cf. A001045 (Jacobsthal), A000244(3^n), A045883.

Programs

  • Magma
    [(3^(n+2) -2^(n+3) -(-1)^n)/12: n in [0..50]]; // G. C. Greubel, Jul 21 2022
    
  • Mathematica
    LinearRecurrence[{4,-1,-6},{0,1,4},30] (* Harvey P. Dale, Apr 02 2017 *)
    Jacob0[n_] := (2^n - (-1)^n)/3; a[n_] := First@ListConvolve[Table[Jacob0[i], {i, 0, n}], 3^Range[0, n]]; Table[a[x], {x, 0, 10}] (* Robert P. P. McKone, Nov 28 2020 *)
  • PARI
    concat(0, Vec(x/((1+x)*(1-2*x)*(1-3*x)) + O(x^50))) \\ Michel Marcus, Sep 13 2014
    
  • SageMath
    [(3^(n+1) - lucas_number1(n+3, 1, -2))/4 for n in (0..50)] # G. C. Greubel, Jul 21 2022

Formula

G.f.: x/((1+x)*(1-2*x)*(1-3*x)).
a(n) = (3^(n+2) - 2^(n+3) - (-1)^n)/12.
a(n) = 4*a(n-1) -a(n-2) -6*a(n-3).
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k+1)*2^(n-k-1)*(3/2)^k. - Paul Barry, Oct 25 2004
a(n) = (3^(n+1) - A001045(n+3))/4. - G. C. Greubel, Jul 21 2022

A124763 Number of non-rises (levels or falls) for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. a(n) is one fewer than the number of maximal strictly increasing runs in this composition. Alternatively, a(n) is the number of weak descents in the same composition. For example, the strictly increasing runs of the 1234567th composition are ((3),(2),(1,2),(2),(1,2,5),(1),(1),(1)), so a(1234567) = 8 - 1 = 7. The 7 weak descents together with the strict ascents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; 2>=1>=1, so a(11) = 2.
The table starts:
  0
  0
  0 1
  0 1 0 2
  0 1 1 2 0 1 1 3
  0 1 1 2 0 2 1 3 0 1 1 2 1 2 2 4
  0 1 1 2 1 2 1 3 0 1 2 3 1 2 2 4 0 1 1 2 0 2 1 3 1 2 2 3 2 3 3 5
		

Crossrefs

Cf. A029931, A066099, A124760, A124761, A124764, A011782 (row lengths), A045883 (row sums), A238343, A333220.
Compositions of n with k weak descents are A333213.
Positions of zeros are A333255.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Partial sums from the right are A048793.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Heinz number is A333219.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are A333489.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Select[Partition[stc[n],2,1],GreaterEqual@@#&]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)

Formula

For a composition b(1),...,b(k), a(n) = Sum_{1<=i=1=b(i+1)} 1.
a(n) = A124761(n) + A124762(n).
For n > 0, a(n) = A124768(n) - 1. - Gus Wiseman, Apr 08 2020

A094953 Triangle T(n,m) read by rows: number of rises (drops) in the compositions of n with m parts, m>=2.

Original entry on oeis.org

1, 1, 2, 2, 4, 3, 2, 8, 9, 4, 3, 12, 21, 16, 5, 3, 18, 39, 44, 25, 6, 4, 24, 66, 96, 80, 36, 7, 4, 32, 102, 184, 200, 132, 49, 8, 5, 40, 150, 320, 430, 372, 203, 64, 9, 5, 50, 210, 520, 830, 888, 637, 296, 81, 10, 6, 60, 285, 800, 1480, 1884, 1673, 1024, 414, 100, 11, 6
Offset: 2

Views

Author

Ralf Stephan, May 26 2004

Keywords

Examples

			1
1 2
2 4 3
2 8 9 4
3 12 21 16 5
3 18 39 44 25 6
4 24 66 96 80 36 7
		

Crossrefs

Columns 2-4 (+-offset) are A004526, A007590, A007518.
Row sums are A045883, diagonals include n, n^2, (n-1)(n^2-n+2)/2, (n-1)^2(n^+n+6), etc.
Cf. A045927.

Programs

  • Mathematica
    T[n_, m_] := SeriesCoefficient[(m-1)x^(m+1)/(1+x)/(1-x)^m, {x, 0, n+1}];
    Table[T[n, m], {n, 2, 13}, {m, 2, n}] // Flatten (* Jean-François Alcover, Dec 03 2018 *)
  • PARI
    T(n,m)=polcoeff((m-1)*x^(m+1)/(1+x)/(1-x)^m,n)

Formula

G.f. of m-th column: [(m-1)x^(m+1)]/[(1+x)(1-x)^m].

A102301 a(n) = ((3*n + 1)*2^(n+3) + 9 + (-1)^n)/18.

Original entry on oeis.org

1, 4, 13, 36, 93, 228, 541, 1252, 2845, 6372, 14109, 30948, 67357, 145636, 313117, 669924, 1427229, 3029220, 6407965, 13514980, 28428061, 59652324, 124897053, 260978916, 544327453, 1133394148, 2356266781, 4891490532, 10140895005, 20997617892, 43426891549
Offset: 0

Views

Author

Creighton Dement, Feb 20 2005

Keywords

Comments

A floretion-generated sequence resulting from particular transform of A000975.
Floretion Algebra Multiplication Program, FAMP Code: 2jesforseq[ + .5'i + 'kk' + .5'jk' ], 1vesforseq(n) = A000975(n+2)*(-1)^(n+1), ForType: 1A, LoopType: tes (2nd iteration)

Crossrefs

Programs

  • Magma
    [((3*n+1)*2^(n+3)+9+(-1)^n)/18: n in [0..40]]; // Vincenzo Librandi, Nov 21 2018
  • Mathematica
    Table[((3n+1)*2^(n+3) + 9 + (-1)^n)/18, {n,0,50}] (* G. C. Greubel, Sep 27 2017 *)
    LinearRecurrence[{4, -3, -4, 4}, {1, 4, 13, 36}, 50] (* Vincenzo Librandi, Nov 21 2018 *)
  • PARI
    a(n)=((3*n+1)*2^(n+3)+9+(-1)^n)/18 \\ Charles R Greathouse IV, Oct 16 2015
    

Formula

G.f.: 1/((1-x^2)*(1-2*x)^2).
a(n+1) - 2*a(n) = A000975(n+2) (n-th number without consecutive equal binary digits)
a(n) + a(n+1) = A000337(n+2);
a(n+1) - a(n) = A045883(n+2);
a(n+2) - a(n) = A001787(n+3) ( Number of edges in n-dimensional hypercube );
a(n+2) - 2*a(n+1) + a(n) = A059570(n+3);
Convolution of "Number of fixed points in all 231-avoiding involutions in S_n" (A059570) with the natural numbers (A000027), treating the result as if offset=0. - Graeme McRae, Jul 12 2006
Equals triangle A059260 * A008574 as a vector, where A008574 = [1, 4, 8, 12, 16, 20, ...]. - Gary W. Adamson, Mar 06 2012

A113861 a(n) = (1/9)*((6*n - 7)*2^(n-1) - (-1)^n).

Original entry on oeis.org

0, 1, 5, 15, 41, 103, 249, 583, 1337, 3015, 6713, 14791, 32313, 70087, 151097, 324039, 691769, 1470919, 3116601, 6582727, 13864505, 29127111, 61050425, 127693255, 266571321, 555512263, 1155763769, 2401006023, 4980969017, 10319851975, 21355531833, 44142719431
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2006

Keywords

Comments

This sequence is connected with the Collatz problem (see the sequences A045883 and A001045). - Michel Lagneau, Jan 13 2012

Crossrefs

Programs

Formula

a(n+1) - 2*a(n) = A001045(n+2), Jacobsthal numbers. - Paul Curtz, Jul 05 2008
3*a(n) - a(n+1) = -1, -2, 4*a(n). - Paul Curtz, Jul 05 2008
From R. J. Mathar, Nov 11 2008: (Start)
G.f.: x^2*(1+2*x)/((1+x)*(1-2*x)^2).
a(n) + a(n+1) = A014480(n-1). (End)
a(n) = 4*a(n-1) - 4*a(n-2) + (-1)^(n+1), n>2. - Gary Detlefs, Dec 19 2010
a(n) = 3*a(n-1) - 4*a(n-3), n>3. - Gary Detlefs, Dec 19 2010
a(n) = n*2^n - A045883(n). - Michel Lagneau, Jan 13 2012
Starting with "1" = triangle A059260 * A016813 as a vector, where A016813 = (4n + 1): [ 1, 5, 9, 13, ...]. - Gary W. Adamson, Mar 06 2012

A137241 Number triples (k,3-k,2-2k), concatenated for k=0, 1, 2, 3,...

Original entry on oeis.org

0, 3, 2, 1, 2, 0, 2, 1, -2, 3, 0, -4, 4, -1, -6, 5, -2, -8, 6, -3, -10, 7, -4, -12, 8, -5, -14, 9, -6, -16, 10, -7, -18, 11, -8, -20, 12, -9, -22, 13, -10, -24, 14, -11, -26, 15, -12, -28, 16, -13, -30, 17, -14, -32, 18, -15, -34, 19, -16, -36, 20, -17, -38, 21, -18, -40
Offset: 0

Views

Author

Paul Curtz, Mar 09 2008

Keywords

Comments

The entries are the coefficients in a family of Jacobsthal recurrences: a(n)=k*a(n-1)+(3-k)*a(n-2)+(2-2k)*a(n-3).
Examples for k=0 are in A001045 and A113954. Examples for k=1 are A001045, A078008.
Examples for k=2 are A000975, A087288, A084639, A000012 and A001045.
Examples for k=3 are A045883, A059570. Examples for k=4 are A094705 and A015518.

Examples

			The triples (k,3-k,2-2k) are (0,3,2), (1,2,0), (2,1,-2), (3,0,-4),...
		

Programs

  • Mathematica
    CoefficientList[Series[x*(3 + 2*x + x^2 - 4*x^3 - 4*x^4)/((x - 1)^2*(1 + x + x^2)^2), {x, 0, 50}], x] (* G. C. Greubel, Sep 28 2017 *)
    Table[{n,3-n,2-2n},{n,0,30}]//Flatten (* or *) LinearRecurrence[ {0,0,2,0,0,-1},{0,3,2,1,2,0},100] (* Harvey P. Dale, Jun 23 2019 *)
  • PARI
    x='x+O('x^50); Vec(x*(3+2*x+x^2-4*x^3-4*x^4)/((x-1)^2*(1+x +x^2 )^2)) \\ G. C. Greubel, Sep 28 2017

Formula

From R. J. Mathar, Feb 25 2009: (Start)
a(n) = 2*a(n-3) - a(n-6).
G.f.: x*(3+2*x+x^2-4*x^3-4*x^4)/((x-1)^2*(1+x+x^2)^2). (End)

Extensions

Edited by R. J. Mathar, Jun 28 2008

A140944 Triangle T(n,k) read by rows, the k-th term of the n-th differences of the Jacobsthal sequence A001045.

Original entry on oeis.org

0, 1, 0, -1, 2, 0, 3, -2, 4, 0, -5, 6, -4, 8, 0, 11, -10, 12, -8, 16, 0, -21, 22, -20, 24, -16, 32, 0, 43, -42, 44, -40, 48, -32, 64, 0, -85, 86, -84, 88, -80, 96, -64, 128, 0, 171, -170, 172, -168, 176, -160, 192, -128, 256, 0, -341, 342, -340, 344, -336, 352, -320, 384, -256, 512, 0
Offset: 0

Views

Author

Paul Curtz, Jul 24 2008

Keywords

Comments

A variant of the triangle A140503, now including the diagonal.
Since the diagonal contains zeros, rows sums are those of A140503.

Examples

			Triangle begins as:
    0;
    1,   0;
   -1,   2,   0;
    3,  -2,   4,  0;
   -5,   6,  -4,  8,   0;
   11, -10,  12, -8,  16,  0;
  -21,  22, -20, 24, -16, 32,  0;
		

Crossrefs

Programs

  • Magma
    [2^k*(1-(-2)^(n-k))/3: k in [0..n], n in [0..15]]; // G. C. Greubel, Feb 18 2023
    
  • Maple
    A001045:= n -> (2^n-(-1)^n)/3;
    A140944:= proc(n,k) if n = 0 then A001045(k); else procname(n-1,k+1)-procname(n-1,k) ; fi; end:
    seq(seq(A140944(n,k),k=0..n),n=0..10); # R. J. Mathar, Sep 07 2009
  • Mathematica
    T[0, 0]=0; T[1, 0]= T[0, 1]= 1; T[0, k_]:= T[0, k]= T[0, k-1] + 2*T[0, k-2]; T[n_, n_]=0; T[n_, k_]:= T[n, k] = T[n-1, k+1] - T[n-1, k]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* Jean-François Alcover, Dec 17 2014 *)
    Table[2^k*(1-(-2)^(n-k))/3, {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 18 2023 *)
  • PARI
    T(n, k) = (2^k - 2^n*(-1)^(n+k))/3 \\ Jianing Song, Aug 11 2022
    
  • SageMath
    def A140944(n,k): return 2^k*(1 - (-2)^(n-k))/3
    flatten([[A140944(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Feb 18 2023

Formula

T(n, k) = T(n-1, k+1) - T(n-1, k). T(0, k) = A001045(k).
T(n, k) = (2^k - 2^n*(-1)^(n+k))/3, for n >= k >= 0. - Jianing Song, Aug 11 2022
From G. C. Greubel, Feb 18 2023: (Start)
T(n, n-1) = A000079(n).
T(2*n, n) = (-1)^(n+1)*A192382(n+1).
T(2*n, n-1) = (-1)^n*A246036(n-1).
T(2*n, n+1) = A083086(n).
T(3*n, n) = -A115489(n).
Sum_{k=0..n} T(n, k) = A052992(n)*[n>0] + 0*[n=0].
Sum_{k=0..n} (-1)^k*T(n, k) = A045883(n).
Sum_{k=0..n} 2^k*T(n, k) = A084175(n).
Sum_{k=0..n} (-2)^k*T(n, k) = (-1)^(n+1)*A109765(n).
Sum_{k=0..n} 3^k*T(n, k) = A091056(n+1).
Sum_{k=0..floor(n/2)} T(n-k, k) = (-1)^(n+1)*A097038(n).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (-1)^(n+1)*A138495(n). (End)

Extensions

Edited and extended by R. J. Mathar, Sep 07 2009

A140960 a(n) = (2*(-1)^n - 2^(n+1) + 3*n*2^n)/9.

Original entry on oeis.org

0, 0, 2, 6, 18, 46, 114, 270, 626, 1422, 3186, 7054, 15474, 33678, 72818, 156558, 334962, 713614, 1514610, 3203982, 6757490, 14214030, 29826162, 62448526, 130489458, 272163726, 566697074, 1178133390, 2445745266, 5070447502, 10498808946, 21713445774, 44858547314
Offset: 0

Views

Author

Paul Curtz, Jul 26 2008

Keywords

Comments

Specify that a triangle has T(n,0) = T(n,n) = A001045(n), and T(r,c) = T(r-1,c-1) + T(r-1,c). The sum of the terms in the first n rows is a(n+1). - J. M. Bergot, May 21 2013
a(n) is the difference between the total number of runs of equal parts in the compositions of n+1, and the compositions of n+1. - Gregory L. Simay, May 04 2017

Programs

  • Magma
    [( 2*(-1)^n-2^(n+1)+3*n*2^n)/9: n in [0..40]]; // Vincenzo Librandi, Aug 08 2011
    
  • Mathematica
    LinearRecurrence[{3,0,-4},{0,0,2},40] (* Harvey P. Dale, Apr 14 2015 *)
  • PARI
    a(n)=(2*(-1)^n-2^(n+1)+3*n*2^n)/9 \\ Charles R Greathouse IV, Oct 16 2015

Formula

a(n+1) - 2*a(n) = A078008(n+1) = 2*A001045(n).
G.f.: 2*x^2/((1+x)*(1-2*x)^2).
a(n) = 2*A045883(n-1).
a(n) = 3*a(n-1) - 4*a(n-3), n > 2.
a(n) = A059570(n+1) - A011782(n+1). - Gregory L. Simay, May 04 2017

Extensions

Definition replaced with Lava's closed form of August 2008 by R. J. Mathar, Feb 11 2010

A140503 Triangle T(d,n) read by rows, the n-th term of the d-th differences of the Jacobsthal sequence A001045.

Original entry on oeis.org

1, -1, 2, 3, -2, 4, -5, 6, -4, 8, 11, -10, 12, -8, 16, -21, 22, -20, 24, -16, 32, 43, -42, 44, -40, 48, -32, 64, -85, 86, -84, 88, -80, 96, -64, 128, 171, -170, 172, -168, 176, -160, 192, -128, 256, -341, 342, -340, 344, -336, 352, -320, 384, -256, 512, 683, -682, 684, -680
Offset: 1

Views

Author

Paul Curtz, Jun 30 2008

Keywords

Comments

If interpreted as a flat sequence a(j), we obtain a(j+1)-2a(j)= -3, 4, -1, -8, 8, -13, 16, -16, 16, -5, -32, 32, -32, 32, -53, 64, ... which is essentially the negative values of A096773 padded by groups of one, then two, then three etc. signed elements of A098354.

Examples

			A001045 and its d times iterated differences are
.0,.1,.1,.3,.5,11,21,43,...
.1,.0,.2,.2,.6,10,22,... < d=1
-1,.2,.0,.4,.4,12,... < d=2
.3,-2,.4,.0,.8,.. < d=3
-5,.6,-4,.8,.0,...
The sequence contains the first d elements of the d-th row, those up to the diagonal (which contains zeros).
		

Crossrefs

Cf. A001045, A140944 (with an extra diagonal of 0's).

Programs

  • PARI
    T(d,n) = (2^n - 2^d*(-1)^(d+n))/3 \\ Jianing Song, Aug 11 2022

Formula

T(d,n)=T(d-1,n+1)-T(d-1,n). T(0,n)=A001045(n).
Row sums: sum_{n=0..d-1} T(d,n) = A002450([(d+1)/2]).
Row sums of absolute values: sum_{n=0..d-1} |T(d,n)| = A045883(d).
T(d,n) = (2^n - 2^d*(-1)^(d+n))/3, for d > n >= 0. - Jianing Song, Aug 11 2022

Extensions

Edited by R. J. Mathar, Jul 14 2008

A246788 Triangle read by rows: T(n,k) is the coefficient A_k in the transformation Sum_{k=0..n} (k+1)*x^k = Sum_{k=0..n} A_k*(x+2)^k.

Original entry on oeis.org

1, -3, 2, 9, -10, 3, -23, 38, -21, 4, 57, -122, 99, -36, 5, -135, 358, -381, 204, -55, 6, 313, -986, 1299, -916, 365, -78, 7, -711, 2598, -4077, 3564, -1875, 594, -105, 8, 1593, -6618, 12051, -12564, 8205, -3438, 903, -136, 9, -3527, 16422, -34029, 41196, -32115, 16722, -5817, 1304, -171, 10
Offset: 0

Views

Author

Derek Orr, Nov 15 2014

Keywords

Comments

Consider the transformation 1 + 2x + 3x^2 + 4x^3 + ... + (n+1)*x^n = A_0*(x+2)^0 + A_1*(x+2)^1 + A_2*(x+2)^2 + ... + A_n*(x+2)^n. This sequence gives A_0, ... A_n as the entries in the n-th row of this triangle, starting at n = 0.

Examples

			1;
-3,        2;
9,       -10,      3;
-23,      38,    -21,      4;
57,     -122,     99,    -36,      5;
-135,    358,   -381,    204,    -55,     6;
313,    -986,   1299,   -916,    365,   -78,     7;
-711,   2598,  -4077,   3564,  -1875,   594,  -105,    8;
1593,  -6618,  12051, -12564,   8205, -3438,   903, -136,    9;
-3527, 16422, -34029,  41196, -32115, 16722, -5817, 1304, -171, 10;
		

Crossrefs

Programs

  • PARI
    T(n,k) = (k+1)*sum(i=0,n-k,(-2)^i*binomial(i+k+1,k+1))
    for(n=0,10,for(k=0,n,print1(T(n,k),", ")))

Formula

T(n,0) = ((6*n+8)*(-2)^n+1)/9, for n >= 0.
T(n,n-1) = -n*(2*n+1), for n >= 1.
Row n sums to A001057(n+1).
Previous Showing 11-20 of 28 results. Next