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

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

Original entry on oeis.org

1, 1, 2, 4, 7, 14, 26, 50, 95, 181, 345, 657, 1252, 2385, 4544, 8657, 16493, 31422, 59864, 114051, 217286, 413966, 788674, 1502555, 2862617, 5453761, 10390321, 19795288, 37713313, 71850128, 136886433, 260791401, 496850954, 946583628
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) = number of compositions of n with parts in {2,1,3,5,7,9,...}. The generating function follows easily from Theorem 1.1 of the Hoggatt et al. reference. Example: a(4)= 7 because we have 22, 31, 13, 211, 121, 112, and 1111. - Emeric Deutsch, Aug 17 2016.
Diagonal sums of A054142. - Paul Barry, Jan 21 2005
Equals INVERT transform of (1, 1, 1, 0, 1, 0, 1, 0, 1, ...). - Gary W. Adamson, Apr 27 2009
Number of tilings of a 4 X 2n rectangle by 4 X 1 tetrominoes. - M. Poyraz Torcuk, Dec 10 2021

Crossrefs

Cf. A275446.
Bisection of A003269 (odd part),

Programs

  • GAP
    a:=[1,1,2,4];; for n in [5..40] do a[n]:=a[n-1]+2*a[n-2]-a[n-4]; od; a; # G. C. Greubel, May 09 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x^2)/( 1-x-2*x^2+x^4) )); // G. C. Greubel, May 09 2019
    
  • Maple
    spec := [S,{S=Sequence(Prod(Z,Union(Z,Sequence(Prod(Z,Z)))))},unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
  • Mathematica
    CoefficientList[Series[(1-x^2)/(1-x-2x^2+x^4), {x, 0, 40}], x] (* or *)
    Table[Length@ Flatten[Map[Permutations, DeleteCases[IntegerPartitions@ n, {_, a_, _} /; And[EvenQ@ a, a != 2]]], 1], {n, 0, 40}]  (* Michael De Vlieger, Aug 17 2016 *)
    LinearRecurrence[{1,2,0,-1},{1,1,2,4},40] (* Harvey P. Dale, Apr 12 2018 *)
  • PARI
    my(x='x+O('x^40)); Vec((1-x^2)/(1-x-2*x^2+x^4)) \\ G. C. Greubel, May 09 2019
    
  • Sage
    ((1-x^2)/(1-x-2*x^2+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 09 2019
    

Formula

G.f.: (1 - x^2)/(1 - x - 2*x^2 + x^4).
a(n) = a(n-1) + 2*a(n-2) - a(n-4), with a(0)=1, a(1)=1, a(2)=2, a(3)=4.
a(n) = Sum_{alpha = RootOf(1-x-2*x^2+x^4)} (1/283)*(27 + 112*alpha + 9*alpha^2 -48*alpha^3)*alpha^(-n-1).
a(n) = Sum_{k=0..floor(n/2)} binomial(2*n-3*k, k). - Paul Barry, Jan 21 2005
a(n) = A158943(n) -A158943(n-2). - R. J. Mathar, Jan 13 2023

Extensions

More terms from James Sellers, Jun 05 2000

A103632 Expansion of (1 - x + x^2)/(1 - x - x^4).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 3, 4, 6, 8, 11, 15, 21, 29, 40, 55, 76, 105, 145, 200, 276, 381, 526, 726, 1002, 1383, 1909, 2635, 3637, 5020, 6929, 9564, 13201, 18221, 25150, 34714, 47915, 66136, 91286, 126000, 173915, 240051, 331337, 457337, 631252, 871303, 1202640
Offset: 0

Views

Author

Paul Barry, Feb 11 2005

Keywords

Comments

Diagonal sums of A103631.
The Kn11 sums, see A180662, of triangle A065941 equal the terms of this sequence without a(0) and a(1). - Johannes W. Meijer, Aug 11 2011
For n >= 2, a(n) is the number of palindromic compositions of n-2 with parts in {2,1,3,5,7,9,...}. The generating function follows easily from Theorem 1,2 of the Hoggatt et al. reference. Example: a(9) = 8 because we have 7, 151, 11311, 232, 313, 12121, 21112, and 1111111. - Emeric Deutsch, Aug 17 2016
Essentially the same as A003411. - Georg Fischer, Oct 07 2018

Crossrefs

Cf. A275446.

Programs

  • GAP
    a:=[1,0,1,1];;  for n in [5..50] do a[n]:=a[n-1]+a[n-4]; od; a; # Muniru A Asiru, Oct 07 2018
    
  • Magma
    I:=[1,0,1,1]; [n le 4 select I[n] else Self(n-1) + Self(n-4): n in [1..50]]; // G. C. Greubel, Mar 10 2019
    
  • Maple
    A103632 := proc(n): add( binomial(floor((2*n-3*k-1)/2), n-2*k), k=0..floor(n/2)) end: seq(A103632(n), n=0..46); # Johannes W. Meijer, Aug 11 2011
  • Mathematica
    LinearRecurrence[{1,0,0,1}, {1,0,1,1}, 50] (* G. C. Greubel, Mar 10 2019 *)
  • PARI
    my(x='x+O('x^50)); Vec((1-x+x^2)/(1-x-x^4)) \\ G. C. Greubel, Mar 10 2019
    
  • Sage
    ((1-x+x^2)/(1-x-x^4)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Mar 10 2019

Formula

G.f.: (1 - x + x^2)/(1 - x - x^4).
a(n) = a(n-1) + a(n-4) with a(0)=1, a(1)=0, a(2)=1 and a(3)=1.
a(n) = Sum_{k=0..floor(n/2)} binomial(floor((2*n-3*k-1)/2), n-2*k).
a(n) = A003269(n+1) - A003269(n-4), n > 4.

Extensions

Formula corrected by Johannes W. Meijer, Aug 11 2011

A275442 Triangle read by rows: T(n,k) is the number of compositions without 2's and having asymmetry degree equal to k (n>=0; 0<=k<=floor(n/4)).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 4, 8, 5, 16, 7, 26, 4, 9, 44, 12, 12, 70, 32, 16, 108, 76, 21, 166, 156, 8, 28, 248, 308, 32, 37, 368, 572, 104, 49, 540, 1020, 288, 65, 784, 1768, 696, 16, 86, 1132, 2976, 1568, 80, 114, 1622, 4908, 3304, 304, 151, 2312, 7944, 6624, 960, 200, 3280, 12652, 12768, 2640, 32
Offset: 0

Views

Author

Emeric Deutsch, Aug 16 2016

Keywords

Comments

The asymmetry degree of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. Example: the asymmetry degree of (2,7,6,4,5,7,3) is 2, counting the pairs (2,3) and (6,5).
Number of entries in row n is 1 + floor(n/4).
Sum of entries in row n is A005251(n+1).
T(n,0) = A000931(n+5) (= number of palindromic compositions of n without 2's).
Sum_{k >= 0} k*T(n,k) = A275443(n).

Examples

			Row 5 is [3,4] because the compositions of 5 without 2's are 5, 113, 131, 311, 14, 41, and 11111, having asymmetry degrees 0, 1, 0, 1, 1, 1, and 0, respectively.
Triangle starts:
  1;
  1;
  1;
  2;
  2,2;
  3,4;
  4,8;
  5,16.
		

References

  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.

Crossrefs

Programs

  • Maple
    G := (1-z^2)/(1-z-z^2+z^4-2*t*z^4): Gser := simplify(series(G, z = 0, 30)): for n from 0 to 25 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 25 do seq(coeff(P[n], t, j), j = 0 .. degree(P[n])) end do; # yields sequence in triangular form
  • Mathematica
    Table[BinCounts[#, {0, 1 + Floor[n/4], 1}] &@ Map[Total, Map[Map[Boole[# >= 1] &, BitXor[Take[# - 1, Ceiling[Length[#]/2]], Reverse@ Take[# - 1, -Ceiling[Length[#]/2]]]] &, Flatten[Map[Permutations, DeleteCases[IntegerPartitions@ n, {_, a_, _} /; a == 2]], 1]]], {n, 0, 20}] // Flatten (* Michael De Vlieger, Aug 17 2016 *)
  • PARI
    T_zt(max_row) = {my(N = max_row+1, z='z+O('z^N), h=(1-z^2)/(1-z-z^2+z^4-2*t*z^4)); vector(N, n, Vecrev(polcoeff(h, n-1)))}
    T_zt(10) \\ John Tyler Rascoe, May 09 2025

Formula

G.f.: G(t,z) = (1-z^2)/(1-z-z^2+z^4-2*t*z^4). In the more general situation of compositions into a[1]=1} z^(a[j]), we have G(t,z) = (1 + F(z))/(1 - F(z^2) - t*(F(z)^2 - F(z^2))). In particular, for t=0 we obtain Theorem 1.2 of the Hoggatt et al. reference.

A275447 Sum of the asymmetry degrees of all compositions of n with parts in {2,1,3,5,7,9,...}.

Original entry on oeis.org

0, 0, 0, 2, 4, 10, 24, 54, 120, 258, 552, 1164, 2432, 5042, 10384, 21268, 43344, 87962, 177840, 358358, 719964, 1442584, 2883504, 5751020, 11447164, 22743262, 45110096, 89334192, 176658732, 348875904, 688122336, 1355674528, 2667921660, 5245033102
Offset: 0

Views

Author

Emeric Deutsch, Aug 17 2016

Keywords

Comments

The asymmetry degree of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. Example: the asymmetry degree of (2,7,6,4,5,7,3) is 2, counting the pairs (2,3) and (6,5).
A sequence is palindromic if and only if its asymmetry degree is 0.

Examples

			a(4) = 4 because the compositions of 4 with parts in {2,1,3,5,7,...} are 22, 31, 13, 211, 121, 112, and 1111 and the sum of their asymmetry degrees is 0 + 1 + 1 + 1 + 0 + 1 + 0 = 4.
		

References

  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.

Crossrefs

Cf. A275446.

Programs

  • Maple
    g := 2*z^3*(1-z^2)/((1+z^2)*(1-z-2*z^2+z^4)^2): gser := series(g, z = 0, 45): seq(coeff(gser, z, n), n = 0 .. 40);
  • Mathematica
    Table[Total@ Map[Total, Map[Map[Boole[# >= 1] &, BitXor[Take[# - 1, Ceiling[Length[#]/2]], Reverse@ Take[# - 1, -Ceiling[Length[#]/2]]]] &, Flatten[Map[Permutations, DeleteCases[ IntegerPartitions@ n, {_, a_, _} /; And[EvenQ@ a, a != 2]]], 1]]], {n, 0, 21}] // Flatten (* Michael De Vlieger, Aug 17 2016 *)
  • PARI
    concat(vector(3), Vec(2*x^3*(1-x^2)/((1+x^2)*(1-x-2*x^2+x^4)^2) + O(x^50))) \\ Colin Barker, Aug 28 2016

Formula

G.f.: g(z) = 2*z^3*(1-z^2)/((1+z^2)*(1-z-2*z^2+z^4)^2). In the more general situation of compositions into a[1]=1} z^(a[j]), we have g(z) = (F(z)^2 - F(z^2))/((1+F(z))*(1-F(z))^2).
a(n) = Sum_{k>=0} k*A275446(n,k).
Showing 1-4 of 4 results.